diff --git a/data/styles/Application.css b/data/styles/Application.css index 572d235f..5f0c47be 100644 --- a/data/styles/Application.css +++ b/data/styles/Application.css @@ -36,10 +36,24 @@ 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(@highlight_color, 0.6); +} + +panel.maximized indicator:checked > revealer { + background: alpha(white, 0.3); +} + .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 +71,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;