DisplaySettings: Made select wallpaper use allowed file types

This commit is contained in:
Marcus Nilsson 2023-01-11 22:56:29 +01:00 committed by Andrew Kaster
commit feef83359d
Notes: sideshowbarker 2024-07-17 00:55:18 +09:00

View file

@ -21,6 +21,7 @@
#include <LibGUI/Desktop.h>
#include <LibGUI/FilePicker.h>
#include <LibGUI/FileSystemModel.h>
#include <LibGUI/FileTypeFilter.h>
#include <LibGUI/IconView.h>
#include <LibGUI/ItemListModel.h>
#include <LibGUI/MessageBox.h>
@ -86,7 +87,7 @@ void BackgroundSettingsWidget::create_frame()
auto& button = *find_descendant_of_type_named<GUI::Button>("wallpaper_open_button");
button.on_click = [this](auto) {
auto path = GUI::FilePicker::get_open_filepath(window(), "Select wallpaper from file system", "/res/wallpapers"sv);
auto path = GUI::FilePicker::get_open_filepath(window(), "Select wallpaper from file system", "/res/wallpapers"sv, false, GUI::Dialog::ScreenPosition::CenterWithinParent, { { GUI::FileTypeFilter::image_files(), GUI::FileTypeFilter::all_files() } });
if (!path.has_value())
return;
m_wallpaper_view->selection().clear();