diff --git a/Userland/Applications/DisplaySettings/ThemesSettings.gml b/Userland/Applications/DisplaySettings/ThemesSettings.gml index 2ea553c042..28b2aaa16c 100644 --- a/Userland/Applications/DisplaySettings/ThemesSettings.gml +++ b/Userland/Applications/DisplaySettings/ThemesSettings.gml @@ -4,29 +4,55 @@ margins: [8] } - @GUI::Frame { - layout: @GUI::HorizontalBoxLayout {} - name: "preview_frame" - fixed_width: 306 - fixed_height: 201 - } + @GUI::GroupBox { + layout: @GUI::VerticalBoxLayout { + margins: [14, 14, 4] + } + title: "Window Theme" + fixed_height: 294 - @GUI::Widget { - fixed_height: 20 - } - - @GUI::Widget { - shrink_to_fit: true - layout: @GUI::HorizontalBoxLayout {} - - @GUI::Label { - text: "Theme:" - text_alignment: "CenterLeft" - fixed_width: 95 + @GUI::Frame { + layout: @GUI::HorizontalBoxLayout {} + name: "preview_frame" + fixed_width: 306 + fixed_height: 201 } - @GUI::ComboBox { - name: "themes_combo" + @GUI::Widget { + fixed_height: 20 + } + + @GUI::Widget { + shrink_to_fit: true + layout: @GUI::HorizontalBoxLayout {} + + @GUI::Label { + text: "Theme:" + text_alignment: "CenterLeft" + fixed_width: 95 + } + + @GUI::ComboBox { + name: "themes_combo" + } + } + } + + @GUI::GroupBox { + layout: @GUI::VerticalBoxLayout { + margins: [14, 14, 4] + } + title: "Cursor Theme" + shrink_to_fit: true + + @GUI::Button { + name: "cursor_themes_button" + text: "Change in Mouse Settings..." + fixed_width: 200 + } + + @GUI::Widget { + fixed_height: 10 } } } diff --git a/Userland/Applications/DisplaySettings/ThemesSettingsWidget.cpp b/Userland/Applications/DisplaySettings/ThemesSettingsWidget.cpp index f218da20d7..917035f08d 100644 --- a/Userland/Applications/DisplaySettings/ThemesSettingsWidget.cpp +++ b/Userland/Applications/DisplaySettings/ThemesSettingsWidget.cpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace DisplaySettings { @@ -36,7 +37,6 @@ ThemesSettingsWidget::ThemesSettingsWidget(bool& background_settings_changed) } } VERIFY(m_selected_theme); - m_theme_preview = find_descendant_of_type_named("preview_frame")->add(palette()); m_themes_combo = *find_descendant_of_type_named("themes_combo"); m_themes_combo->set_only_allow_values_from_model(true); @@ -47,6 +47,13 @@ ThemesSettingsWidget::ThemesSettingsWidget(bool& background_settings_changed) set_modified(true); }; m_themes_combo->set_selected_index(current_theme_index, GUI::AllowCallback::No); + + auto mouse_settings_icon = Gfx::Bitmap::try_load_from_file("res/icons/16x16/app-mouse.png").release_value_but_fixme_should_propagate_errors(); + m_cursor_themes_button = *find_descendant_of_type_named("cursor_themes_button"); + m_cursor_themes_button->set_icon(mouse_settings_icon); + m_cursor_themes_button->on_click = [&](auto) { + GUI::Process::spawn_or_show_error(window(), "/bin/MouseSettings", Array { "-t", "cursor-theme" }); + }; } void ThemesSettingsWidget::apply_settings() diff --git a/Userland/Applications/DisplaySettings/ThemesSettingsWidget.h b/Userland/Applications/DisplaySettings/ThemesSettingsWidget.h index 7975487148..654e8a9fb9 100644 --- a/Userland/Applications/DisplaySettings/ThemesSettingsWidget.h +++ b/Userland/Applications/DisplaySettings/ThemesSettingsWidget.h @@ -28,9 +28,10 @@ private: RefPtr m_themes_combo; RefPtr m_theme_preview; - Gfx::SystemThemeMetaData const* m_selected_theme { nullptr }; + RefPtr m_cursor_themes_button; + bool& m_background_settings_changed; ThemesSettingsWidget(bool& background_settings_changed); diff --git a/Userland/Applications/DisplaySettings/main.cpp b/Userland/Applications/DisplaySettings/main.cpp index a247e6a9e7..2b83b5f5c5 100644 --- a/Userland/Applications/DisplaySettings/main.cpp +++ b/Userland/Applications/DisplaySettings/main.cpp @@ -21,7 +21,7 @@ ErrorOr serenity_main(Main::Arguments arguments) { - TRY(Core::System::pledge("stdio thread recvfd sendfd rpath cpath wpath unix")); + TRY(Core::System::pledge("stdio thread recvfd sendfd rpath cpath wpath unix proc exec")); auto app = TRY(GUI::Application::try_create(arguments)); Config::pledge_domain("WindowManager");