From e495e5baf09cc452b71827c356bf2b0d71eefbeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 27 Aug 2026 19:12:39 -0700 Subject: [PATCH 1/3] Indicator: add checked state --- data/styles/Application.css | 23 +++++++++++------------ src/Services/PopoverManager.vala | 5 +++++ src/Widgets/IndicatorEntry.vala | 4 ++++ 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/data/styles/Application.css b/data/styles/Application.css index 572d235f..0d610ea2 100644 --- a/data/styles/Application.css +++ b/data/styles/Application.css @@ -36,10 +36,20 @@ panel.translucent.color-light > box { 0 1px 1px alpha(black, 0.05); } +indicator > revealer { + border-radius: 0.25rem; + margin: 0.25rem; + padding: 0 0.5rem; + transition: background 200ms cubic-bezier(0.4, 0, 0.2, 1); +} + +indicator:checked > revealer { + background: alpha(@bg_color, 0.5); +} + .composited-indicator { color: white; font-weight: bold; - padding: 0 6px; text-shadow: 0 0 2px alpha(black, 0.3), 0 1px 2px alpha(black, 0.6); @@ -57,17 +67,6 @@ panel.translucent.color-light > box { warning mix(@BANANA_300, @BANANA_500, 0.5); } -/*FIXME: Replace with border-spacing in GTK4*/ -.composited-indicator image + label, -.composited-indicator image + revealer { - padding-left: 0.5em; -} - -.composited-indicator:dir(rtl) image + label, -.composited-indicator:dir(rtl) image + revealer { - padding-right: 0.5em; -} - .color-light .composited-indicator { color: alpha(black, 0.65); text-shadow: diff --git a/src/Services/PopoverManager.vala b/src/Services/PopoverManager.vala index 75bb826a..9dcef896 100644 --- a/src/Services/PopoverManager.vala +++ b/src/Services/PopoverManager.vala @@ -39,11 +39,14 @@ public class Wingpanel.Services.PopoverManager : Object { } else if (value == null && _current_indicator != null) { // Close requested indicator_open = false; _current_indicator.base_indicator.closed (); + _current_indicator.set_state_flags (NORMAL, true); _current_indicator = null; } else if (_current_indicator.base_indicator.code_name == value.base_indicator.code_name) { // Close due to toggle + _current_indicator.set_state_flags (NORMAL, true); _current_indicator.base_indicator.closed (); _current_indicator = null; } else { // Switch + _current_indicator.set_state_flags (NORMAL, true); update_has_tooltip (_current_indicator.display_widget); _current_indicator.base_indicator.closed (); _current_indicator = value; @@ -55,6 +58,7 @@ public class Wingpanel.Services.PopoverManager : Object { update_has_tooltip (_current_indicator.display_widget, false); popover.set_parent (_current_indicator); popover.popup (); + _current_indicator.set_state_flags (CHECKED, true); _current_indicator.base_indicator.opened (); } else { update_has_tooltip (((Wingpanel.Widgets.IndicatorEntry)popover.parent).display_widget); @@ -72,6 +76,7 @@ public class Wingpanel.Services.PopoverManager : Object { popover.add_css_class ("indicator"); popover.closed.connect (() => { + _current_indicator.set_state_flags (NORMAL, true); current_indicator = null; popover.unparent (); }); diff --git a/src/Widgets/IndicatorEntry.vala b/src/Widgets/IndicatorEntry.vala index 59492744..c5a81404 100644 --- a/src/Widgets/IndicatorEntry.vala +++ b/src/Widgets/IndicatorEntry.vala @@ -71,6 +71,10 @@ public class Wingpanel.Widgets.IndicatorEntry : Granite.Bin { indicator_order[Indicator.SESSION] = 14; } + class construct { + set_css_name ("indicator"); + } + construct { display_widget = base_indicator.get_display_widget (); halign = Gtk.Align.START; From a2317737be8c2c833fde3f29c37142f53ae74cab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 27 Aug 2026 19:17:27 -0700 Subject: [PATCH 2/3] Adjust color --- data/styles/Application.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/styles/Application.css b/data/styles/Application.css index 0d610ea2..dab01010 100644 --- a/data/styles/Application.css +++ b/data/styles/Application.css @@ -44,7 +44,7 @@ indicator > revealer { } indicator:checked > revealer { - background: alpha(@bg_color, 0.5); + background: alpha(@highlight_color, 0.6); } .composited-indicator { From 315dabd051b3e465761020c956857ecb2eba1f02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 27 Aug 2026 19:20:02 -0700 Subject: [PATCH 3/3] Adjust for maximized --- data/styles/Application.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data/styles/Application.css b/data/styles/Application.css index dab01010..5f0c47be 100644 --- a/data/styles/Application.css +++ b/data/styles/Application.css @@ -47,6 +47,10 @@ indicator:checked > revealer { background: alpha(@highlight_color, 0.6); } +panel.maximized indicator:checked > revealer { + background: alpha(white, 0.3); +} + .composited-indicator { color: white; font-weight: bold;