mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 17:52:26 -05:00
DisplayProperties: Do not assert on trying to select unset wallpaper
When wallpapers are not present in WindowServer.ini, don't try to select them in the wallpapers list.
This commit is contained in:
parent
4e394862ce
commit
712e7102b0
Notes:
sideshowbarker
2024-07-19 09:03:01 +09:00
Author: https://github.com/xTibor Commit: https://github.com/SerenityOS/serenity/commit/712e7102b06 Pull-request: https://github.com/SerenityOS/serenity/pull/1308
1 changed files with 5 additions and 4 deletions
|
@ -138,10 +138,11 @@ void DisplayPropertiesWidget::create_frame()
|
|||
|
||||
auto wallpaper_model = wallpaper_list->model();
|
||||
auto find_first_wallpaper_index = m_wallpapers.find_first_index(m_selected_wallpaper);
|
||||
ASSERT(find_first_wallpaper_index.has_value());
|
||||
auto wallpaper_index_in_model = wallpaper_model->index(find_first_wallpaper_index.value(), wallpaper_list->model_column());
|
||||
if (wallpaper_model->is_valid(wallpaper_index_in_model))
|
||||
wallpaper_list->selection().set(wallpaper_index_in_model);
|
||||
if (find_first_wallpaper_index.has_value()) {
|
||||
auto wallpaper_index_in_model = wallpaper_model->index(find_first_wallpaper_index.value(), wallpaper_list->model_column());
|
||||
if (wallpaper_model->is_valid(wallpaper_index_in_model))
|
||||
wallpaper_list->selection().set(wallpaper_index_in_model);
|
||||
}
|
||||
|
||||
wallpaper_list->horizontal_scrollbar().set_visible(false);
|
||||
wallpaper_list->on_selection = [this](auto& index) {
|
||||
|
|
Loading…
Add table
Reference in a new issue