mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:27:45 +00:00
LibGUI+WindowServer+DisplaySettings: Add Tooltips to SystemEffects
Tooltips can now be toggled on and off system-wide.
This commit is contained in:
parent
d286bf85e6
commit
a74f512f6b
5 changed files with 20 additions and 0 deletions
|
@ -96,6 +96,11 @@
|
||||||
text: "Show knurls on splitters"
|
text: "Show knurls on splitters"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GUI::CheckBox {
|
||||||
|
name: "tooltips_checkbox"
|
||||||
|
text: "Show tooltips"
|
||||||
|
}
|
||||||
|
|
||||||
@GUI::Widget {
|
@GUI::Widget {
|
||||||
fixed_height: 4
|
fixed_height: 4
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,6 +68,12 @@ EffectsSettingsWidget::EffectsSettingsWidget()
|
||||||
m_system_effects.effects().at(Effects::SplitterKnurls) = checked;
|
m_system_effects.effects().at(Effects::SplitterKnurls) = checked;
|
||||||
set_modified(true);
|
set_modified(true);
|
||||||
};
|
};
|
||||||
|
auto& tooltips = *find_descendant_of_type_named<GUI::CheckBox>("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<GUI::CheckBox>("menu_shadow_checkbox");
|
auto& menu_shadow = *find_descendant_of_type_named<GUI::CheckBox>("menu_shadow_checkbox");
|
||||||
menu_shadow.set_checked(m_system_effects.menu_shadow());
|
menu_shadow.set_checked(m_system_effects.menu_shadow());
|
||||||
menu_shadow.on_checked = [this](bool checked) {
|
menu_shadow.on_checked = [this](bool checked) {
|
||||||
|
@ -98,6 +104,7 @@ ErrorOr<void> EffectsSettingsWidget::load_settings()
|
||||||
ws_config->read_bool_entry("Effects", "SmoothScrolling", true),
|
ws_config->read_bool_entry("Effects", "SmoothScrolling", true),
|
||||||
ws_config->read_bool_entry("Effects", "TabAccents", true),
|
ws_config->read_bool_entry("Effects", "TabAccents", true),
|
||||||
ws_config->read_bool_entry("Effects", "SplitterKnurls", 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", "MenuShadow", true),
|
||||||
ws_config->read_bool_entry("Effects", "WindowShadow", true),
|
ws_config->read_bool_entry("Effects", "WindowShadow", true),
|
||||||
ws_config->read_bool_entry("Effects", "TooltipShadow", true),
|
ws_config->read_bool_entry("Effects", "TooltipShadow", true),
|
||||||
|
|
|
@ -147,6 +147,8 @@ Action* Application::action_for_shortcut(Shortcut const& shortcut) const
|
||||||
|
|
||||||
void Application::show_tooltip(String tooltip, Widget const* tooltip_source_widget)
|
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;
|
m_tooltip_source_widget = tooltip_source_widget;
|
||||||
if (!m_tooltip_window) {
|
if (!m_tooltip_window) {
|
||||||
m_tooltip_window = TooltipWindow::construct();
|
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)
|
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;
|
m_tooltip_source_widget = tooltip_source_widget;
|
||||||
if (!m_tooltip_window) {
|
if (!m_tooltip_window) {
|
||||||
m_tooltip_window = TooltipWindow::construct();
|
m_tooltip_window = TooltipWindow::construct();
|
||||||
|
|
|
@ -24,6 +24,7 @@ enum Effects : size_t {
|
||||||
SmoothScrolling,
|
SmoothScrolling,
|
||||||
TabAccents,
|
TabAccents,
|
||||||
SplitterKnurls,
|
SplitterKnurls,
|
||||||
|
Tooltips,
|
||||||
MenuShadow,
|
MenuShadow,
|
||||||
WindowShadow,
|
WindowShadow,
|
||||||
TooltipShadow,
|
TooltipShadow,
|
||||||
|
@ -85,6 +86,7 @@ public:
|
||||||
|
|
||||||
bool tab_accents() const { return m_effects[TabAccents]; }
|
bool tab_accents() const { return m_effects[TabAccents]; }
|
||||||
bool splitter_knurls() const { return m_effects[SplitterKnurls]; }
|
bool splitter_knurls() const { return m_effects[SplitterKnurls]; }
|
||||||
|
bool tooltips() const { return m_effects[Tooltips]; }
|
||||||
|
|
||||||
bool menu_shadow() const { return m_effects[MenuShadow]; }
|
bool menu_shadow() const { return m_effects[MenuShadow]; }
|
||||||
bool window_shadow() const { return m_effects[WindowShadow]; }
|
bool window_shadow() const { return m_effects[WindowShadow]; }
|
||||||
|
|
|
@ -2354,6 +2354,7 @@ void WindowManager::apply_system_effects(Vector<bool> effects, ShowGeometry geom
|
||||||
m_config->write_bool_entry("Effects", "SmoothScrolling", m_system_effects.smooth_scrolling());
|
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", "TabAccents", m_system_effects.tab_accents());
|
||||||
m_config->write_bool_entry("Effects", "SplitterKnurls", m_system_effects.splitter_knurls());
|
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", "MenuShadow", m_system_effects.menu_shadow());
|
||||||
m_config->write_bool_entry("Effects", "WindowShadow", m_system_effects.window_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());
|
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", "SmoothScrolling", true),
|
||||||
m_config->read_bool_entry("Effects", "TabAccents", true),
|
m_config->read_bool_entry("Effects", "TabAccents", true),
|
||||||
m_config->read_bool_entry("Effects", "SplitterKnurls", 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", "MenuShadow", true),
|
||||||
m_config->read_bool_entry("Effects", "WindowShadow", true),
|
m_config->read_bool_entry("Effects", "WindowShadow", true),
|
||||||
m_config->read_bool_entry("Effects", "TooltipShadow", true)
|
m_config->read_bool_entry("Effects", "TooltipShadow", true)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue