diff --git a/Userland/Applications/DisplaySettings/EffectsSettings.gml b/Userland/Applications/DisplaySettings/EffectsSettings.gml index e0d62078f09..b0443358e19 100644 --- a/Userland/Applications/DisplaySettings/EffectsSettings.gml +++ b/Userland/Applications/DisplaySettings/EffectsSettings.gml @@ -96,6 +96,11 @@ text: "Show knurls on splitters" } + @GUI::CheckBox { + name: "tooltips_checkbox" + text: "Show tooltips" + } + @GUI::Widget { fixed_height: 4 } diff --git a/Userland/Applications/DisplaySettings/EffectsSettingsWidget.cpp b/Userland/Applications/DisplaySettings/EffectsSettingsWidget.cpp index 0d11ac467a9..e69e8130651 100644 --- a/Userland/Applications/DisplaySettings/EffectsSettingsWidget.cpp +++ b/Userland/Applications/DisplaySettings/EffectsSettingsWidget.cpp @@ -68,6 +68,12 @@ EffectsSettingsWidget::EffectsSettingsWidget() m_system_effects.effects().at(Effects::SplitterKnurls) = checked; set_modified(true); }; + auto& tooltips = *find_descendant_of_type_named("tooltips_checkbox"); + tooltips.set_checked(m_system_effects.tooltips()); + tooltips.on_checked = [this](bool checked) { + m_system_effects.effects().at(Effects::Tooltips) = checked; + set_modified(true); + }; auto& menu_shadow = *find_descendant_of_type_named("menu_shadow_checkbox"); menu_shadow.set_checked(m_system_effects.menu_shadow()); menu_shadow.on_checked = [this](bool checked) { @@ -98,6 +104,7 @@ ErrorOr EffectsSettingsWidget::load_settings() ws_config->read_bool_entry("Effects", "SmoothScrolling", true), ws_config->read_bool_entry("Effects", "TabAccents", true), ws_config->read_bool_entry("Effects", "SplitterKnurls", true), + ws_config->read_bool_entry("Effects", "Tooltips", true), ws_config->read_bool_entry("Effects", "MenuShadow", true), ws_config->read_bool_entry("Effects", "WindowShadow", true), ws_config->read_bool_entry("Effects", "TooltipShadow", true), diff --git a/Userland/Libraries/LibGUI/Application.cpp b/Userland/Libraries/LibGUI/Application.cpp index c3805cc7051..8c962e7aaed 100644 --- a/Userland/Libraries/LibGUI/Application.cpp +++ b/Userland/Libraries/LibGUI/Application.cpp @@ -147,6 +147,8 @@ Action* Application::action_for_shortcut(Shortcut const& shortcut) const void Application::show_tooltip(String tooltip, Widget const* tooltip_source_widget) { + if (!Desktop::the().system_effects().tooltips()) + return; m_tooltip_source_widget = tooltip_source_widget; if (!m_tooltip_window) { m_tooltip_window = TooltipWindow::construct(); @@ -166,6 +168,8 @@ void Application::show_tooltip(String tooltip, Widget const* tooltip_source_widg void Application::show_tooltip_immediately(String tooltip, Widget const* tooltip_source_widget) { + if (!Desktop::the().system_effects().tooltips()) + return; m_tooltip_source_widget = tooltip_source_widget; if (!m_tooltip_window) { m_tooltip_window = TooltipWindow::construct(); diff --git a/Userland/Services/WindowServer/SystemEffects.h b/Userland/Services/WindowServer/SystemEffects.h index 29719b7c7d2..bb686ce35f9 100644 --- a/Userland/Services/WindowServer/SystemEffects.h +++ b/Userland/Services/WindowServer/SystemEffects.h @@ -24,6 +24,7 @@ enum Effects : size_t { SmoothScrolling, TabAccents, SplitterKnurls, + Tooltips, MenuShadow, WindowShadow, TooltipShadow, @@ -85,6 +86,7 @@ public: bool tab_accents() const { return m_effects[TabAccents]; } bool splitter_knurls() const { return m_effects[SplitterKnurls]; } + bool tooltips() const { return m_effects[Tooltips]; } bool menu_shadow() const { return m_effects[MenuShadow]; } bool window_shadow() const { return m_effects[WindowShadow]; } diff --git a/Userland/Services/WindowServer/WindowManager.cpp b/Userland/Services/WindowServer/WindowManager.cpp index ef2614269ed..481121ffc02 100644 --- a/Userland/Services/WindowServer/WindowManager.cpp +++ b/Userland/Services/WindowServer/WindowManager.cpp @@ -2354,6 +2354,7 @@ void WindowManager::apply_system_effects(Vector effects, ShowGeometry geom m_config->write_bool_entry("Effects", "SmoothScrolling", m_system_effects.smooth_scrolling()); m_config->write_bool_entry("Effects", "TabAccents", m_system_effects.tab_accents()); m_config->write_bool_entry("Effects", "SplitterKnurls", m_system_effects.splitter_knurls()); + m_config->write_bool_entry("Effects", "Tooltips", m_system_effects.tooltips()); m_config->write_bool_entry("Effects", "MenuShadow", m_system_effects.menu_shadow()); m_config->write_bool_entry("Effects", "WindowShadow", m_system_effects.window_shadow()); m_config->write_bool_entry("Effects", "TooltipShadow", m_system_effects.tooltip_shadow()); @@ -2370,6 +2371,7 @@ void WindowManager::load_system_effects() m_config->read_bool_entry("Effects", "SmoothScrolling", true), m_config->read_bool_entry("Effects", "TabAccents", true), m_config->read_bool_entry("Effects", "SplitterKnurls", true), + m_config->read_bool_entry("Effects", "Tooltips", true), m_config->read_bool_entry("Effects", "MenuShadow", true), m_config->read_bool_entry("Effects", "WindowShadow", true), m_config->read_bool_entry("Effects", "TooltipShadow", true)