mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:27:45 +00:00
DisplaySettings: Make the copy action copy the background path as url
Closes: #13907
This commit is contained in:
parent
053fc51b7d
commit
92f4408d66
1 changed files with 6 additions and 1 deletions
|
@ -71,7 +71,12 @@ void BackgroundSettingsWidget::create_frame()
|
||||||
m_context_menu->add_action(*m_show_in_file_manager_action);
|
m_context_menu->add_action(*m_show_in_file_manager_action);
|
||||||
|
|
||||||
m_context_menu->add_separator();
|
m_context_menu->add_separator();
|
||||||
m_copy_action = GUI::CommonActions::make_copy_action([this](auto&) { GUI::Clipboard::the().set_plain_text(m_monitor_widget->wallpaper()); }, this);
|
m_copy_action = GUI::CommonActions::make_copy_action(
|
||||||
|
[this](auto&) {
|
||||||
|
auto url = URL::create_with_file_protocol(m_monitor_widget->wallpaper()).to_string();
|
||||||
|
GUI::Clipboard::the().set_data(url.bytes(), "text/uri-list");
|
||||||
|
},
|
||||||
|
this);
|
||||||
m_context_menu->add_action(*m_copy_action);
|
m_context_menu->add_action(*m_copy_action);
|
||||||
|
|
||||||
m_wallpaper_view->on_context_menu_request = [&](const GUI::ModelIndex& index, const GUI::ContextMenuEvent& event) {
|
m_wallpaper_view->on_context_menu_request = [&](const GUI::ModelIndex& index, const GUI::ContextMenuEvent& event) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue