From a46602937480bebefc72a7b417a34607ac9df074 Mon Sep 17 00:00:00 2001 From: Sam Hewitt Date: Wed, 5 Jul 2023 12:30:14 -0230 Subject: [PATCH] panel: Fix drawing functions for light theme Part-of: --- data/theme/gnome-shell-sass/_drawing.scss | 24 +++++++-------- .../gnome-shell-sass/widgets/_panel.scss | 29 +++++++++++-------- js/ui/panel.js | 4 +-- 3 files changed, 30 insertions(+), 27 deletions(-) diff --git a/data/theme/gnome-shell-sass/_drawing.scss b/data/theme/gnome-shell-sass/_drawing.scss index 87d987867..2551d68ae 100644 --- a/data/theme/gnome-shell-sass/_drawing.scss +++ b/data/theme/gnome-shell-sass/_drawing.scss @@ -367,6 +367,7 @@ // $flat: if true, the button is filled instead of transparent // $highlighted_child: if true, applies some special overrides for to a // child element, see _panel.scss for details +// $child_class: class name of the child element // @mixin panel_button($bg:$panel_fg_color, $fg:$panel_fg_color, $flat: true, $highlighted_child: false, $child_class:"") { @@ -382,21 +383,21 @@ @if $flat { box-shadow: none; - &:active, &:overview, &:focus, &:checked { - box-shadow: inset 0 0 0 100px transparentize($bg, 0.75); + &:active, &:focus, &:checked { + box-shadow: inset 0 0 0 100px transparentize($fg, 0.75); &:hover { - box-shadow: inset 0 0 0 100px transparentize($bg, 0.65); + box-shadow: inset 0 0 0 100px transparentize($fg, 0.65); } } &:hover { - box-shadow: inset 0 0 0 100px transparentize($bg, 0.8); + box-shadow: inset 0 0 0 100px transparentize($fg, 0.8); } } @else { box-shadow: inset 0 0 0 100px transparentize($bg, 0.2); - &:active, &:overview, &:focus, &:checked { + &:active, &:focus, &:checked { box-shadow: inset 0 0 0 100px $bg; &:hover { box-shadow: inset 0 0 0 100px transparentize($bg, 0.05); @@ -418,17 +419,14 @@ border-radius: 99px; } - &:active, &:overview, &:focus, &:checked { + &:active, &:focus, &:checked { box-shadow: none !important; #{$child_class} { - box-shadow: inset 0 0 0 100px transparentize($bg, 0.75); - } + box-shadow: inset 0 0 0 100px transparentize($fg, 0.75); - &:hover { - box-shadow: none !important; - #{$child_class} { - box-shadow: inset 0 0 0 100px transparentize($bg, 0.65); + &:hover { + box-shadow: inset 0 0 0 100px transparentize($fg, 0.65) !important; } } } @@ -436,7 +434,7 @@ &:hover { box-shadow: none !important; #{$child_class} { - box-shadow: inset 0 0 0 100px transparentize($bg, 0.8); + box-shadow: inset 0 0 0 100px transparentize($fg, 0.8); } } } diff --git a/data/theme/gnome-shell-sass/widgets/_panel.scss b/data/theme/gnome-shell-sass/widgets/_panel.scss index b8b2a9e3a..d58bc6582 100644 --- a/data/theme/gnome-shell-sass/widgets/_panel.scss +++ b/data/theme/gnome-shell-sass/widgets/_panel.scss @@ -19,18 +19,6 @@ $panel_transition_duration: 250ms; // same as the overview transition duration transition-duration: $panel_transition_duration; box-shadow: inset 0 -1px 0 0 $panel_border_color; - // transparent panel on lock & login screens - &.unlock-screen, - &.login-screen, - &:overview { - background-color: transparent; - box-shadow: none; - - .panel-button { - @include panel_button($panel_system_fg_color); - } - } - // panel menus .panel-button { @include panel_button($panel_fg_color); @@ -92,6 +80,23 @@ $panel_transition_duration: 250ms; // same as the overview transition duration } } + // transparent panel on lock & login screens + &.unlock-screen, + &.login-screen, + &:overview { + background-color: transparent; + box-shadow: none; + + .panel-button { + @include panel_button($panel_system_fg_color, $fg:$panel_system_fg_color); + + // clock + &.clock-display { + @include panel_button($panel_system_fg_color, $fg:$panel_system_fg_color, $highlighted_child: true, $child_class:".clock"); + } + } + } + .panel-status-indicators-box, .panel-status-menu-box { spacing: 2px; diff --git a/js/ui/panel.js b/js/ui/panel.js index 3a99c9e52..49b18926e 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -276,11 +276,11 @@ class ActivitiesButton extends PanelMenu.Button { this.label_actor = this._label; Main.overview.connect('showing', () => { - this.add_style_pseudo_class('overview'); + this.add_style_pseudo_class('checked'); this.add_accessible_state(Atk.StateType.CHECKED); }); Main.overview.connect('hiding', () => { - this.remove_style_pseudo_class('overview'); + this.remove_style_pseudo_class('checked'); this.remove_accessible_state(Atk.StateType.CHECKED); });