mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
DisplaySettings: Allow setting wallpapers from outside /res/wallpapers
Ideally, we would copy the file to `/res/wallpapers`, add an entry to `ComboBox` model and set the index to this entry. I didn't want to touch anything outside of `DisplaySettings`, so this is more of a workaround :^)
This commit is contained in:
@@ -125,6 +125,11 @@ void DisplaySettingsWidget::create_frame()
|
||||
m_wallpaper_combo->set_model(*ItemListModel<AK::String>::create(m_wallpapers));
|
||||
m_wallpaper_combo->on_change = [this](auto& text, const GUI::ModelIndex& index) {
|
||||
String path = text;
|
||||
if (m_monitor_widget->set_wallpaper(path)) {
|
||||
m_monitor_widget->update();
|
||||
return;
|
||||
}
|
||||
|
||||
if (index.row() == 0) {
|
||||
path = "";
|
||||
} else {
|
||||
@@ -136,8 +141,8 @@ void DisplaySettingsWidget::create_frame()
|
||||
}
|
||||
}
|
||||
|
||||
this->m_monitor_widget->set_wallpaper(path);
|
||||
this->m_monitor_widget->update();
|
||||
m_monitor_widget->set_wallpaper(path);
|
||||
m_monitor_widget->update();
|
||||
};
|
||||
|
||||
auto& button = wallpaper_selection_container.add<GUI::Button>();
|
||||
|
||||
Reference in New Issue
Block a user