mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 20:33:10 +00:00
DisplaySettings: Make the copy action copy the background path as url
Closes: #13907
This commit is contained in:
parent
053fc51b7d
commit
92f4408d66
|
@ -71,7 +71,12 @@ void BackgroundSettingsWidget::create_frame()
|
|||
m_context_menu->add_action(*m_show_in_file_manager_action);
|
||||
|
||||
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_wallpaper_view->on_context_menu_request = [&](const GUI::ModelIndex& index, const GUI::ContextMenuEvent& event) {
|
||||
|
|
Loading…
Reference in a new issue