[gnome-shell/wip/snwh/icon-button-fixes: 5/5] css/quick-settings: Update icon-button styles
- From: Sam Hewitt <snwh src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/snwh/icon-button-fixes: 5/5] css/quick-settings: Update icon-button styles
- Date: Tue, 18 Oct 2022 14:53:23 +0000 (UTC)
commit 0f4f0f635e260c6cfc20cd4927ecd366756eaceb
Author: Sam Hewitt <sam snwh org>
Date: Thu Oct 13 14:21:17 2022 -0230
css/quick-settings: Update icon-button styles
- add an entire flat style to button drawing function
- clean up the icon button css in quick settings
- adjust padding in QS sliders
- fixes #5918
data/theme/gnome-shell-sass/_common.scss | 29 ++++++++--------------
data/theme/gnome-shell-sass/_drawing.scss | 5 +++-
data/theme/gnome-shell-sass/widgets/_buttons.scss | 13 ++++++++--
.../gnome-shell-sass/widgets/_quick-settings.scss | 12 ++++-----
js/ui/quickSettings.js | 2 +-
5 files changed, 32 insertions(+), 29 deletions(-)
---
diff --git a/data/theme/gnome-shell-sass/_common.scss b/data/theme/gnome-shell-sass/_common.scss
index f2fe78a3c6..9ca89d182b 100644
--- a/data/theme/gnome-shell-sass/_common.scss
+++ b/data/theme/gnome-shell-sass/_common.scss
@@ -105,24 +105,15 @@ stage {
&:insensitive { @include button(insensitive);}
&:active { @include button(active);}
&:checked { @include button(checked);}
-}
-
-// normal icon-only button
-%icon_button {
- border-radius: 99px;
- border-style: solid;
- border-width: 1px;
- font-weight: bold;
- padding: $base_padding*2;
-
- @include button(normal);
- &:focus { @include button(focus);}
- &:hover { @include button(hover);}
- &:insensitive { @include button(insensitive);}
- &:active { @include button(active);}
- &:checked { @include button(checked);}
- & > StIcon { icon-size: $base_icon_size; }
+ &.flat {
+ @include button(normal, $flat:true);
+ &:focus { @include button(focus, $flat:true);}
+ &:hover { @include button(hover, $flat:true);}
+ &:insensitive { @include button(insensitive, $flat:true);}
+ &:active { @include button(active, $flat:true);}
+ &:checked { @include button(checked, $flat:true);}
+ }
}
// buttons in dialogs/notifications
@@ -143,9 +134,9 @@ $bubble_button_radius:$base_border_radius*1.25;
&:hover { @include button(hover, $c:$bubble_buttons_color);}
&:active { @include button(active, $c:$bubble_buttons_color);}
&:checked { @include button(checked, $c:$bubble_buttons_color);}
-
+
&:first-child:ltr {
- border-radius: 0 0 0 $bubble_button_radius;
+ border-radius: 0 0 0 $bubble_button_radius;
}
&:last-child:ltr {
diff --git a/data/theme/gnome-shell-sass/_drawing.scss b/data/theme/gnome-shell-sass/_drawing.scss
index 8d9a33071b..3a47034920 100644
--- a/data/theme/gnome-shell-sass/_drawing.scss
+++ b/data/theme/gnome-shell-sass/_drawing.scss
@@ -143,7 +143,7 @@
//
// since buttons are all flat an borderless now the mixin is simpler
-@mixin button($t, $tc:$fg_color, $c:$bg_color) {
+@mixin button($t, $tc:$fg_color, $c:$bg_color, $flat: false) {
$button_bg_color: mix($tc, $c, $button_mix_factor);
transition-duration: 100ms;
@@ -152,6 +152,9 @@
@if $t==normal {
color: $tc;
background-color: $button_bg_color;
+ @if $flat {
+ background-color: transparent;
+ }
@if $is_highcontrast == "true" {
box-shadow: inset 0 0 0 1px $button_inset_color;
}
diff --git a/data/theme/gnome-shell-sass/widgets/_buttons.scss
b/data/theme/gnome-shell-sass/widgets/_buttons.scss
index df99524552..def96fe8cd 100644
--- a/data/theme/gnome-shell-sass/widgets/_buttons.scss
+++ b/data/theme/gnome-shell-sass/widgets/_buttons.scss
@@ -6,5 +6,14 @@
}
.icon-button {
- @extend %icon_button; // that's it
-}
+ @extend .button; // same style as buttons
+
+ border-radius: 99px;
+ padding: $base_padding*2;
+ min-height: 16px;
+
+ StIcon {
+ icon-size: $base_icon_size;
+ -st-icon-style: symbolic;
+ }
+}
\ No newline at end of file
diff --git a/data/theme/gnome-shell-sass/widgets/_quick-settings.scss
b/data/theme/gnome-shell-sass/widgets/_quick-settings.scss
index 4e84cdf6f4..b429a2dc50 100644
--- a/data/theme/gnome-shell-sass/widgets/_quick-settings.scss
+++ b/data/theme/gnome-shell-sass/widgets/_quick-settings.scss
@@ -48,8 +48,6 @@
}
.quick-slider {
- padding: 0 $base_padding;
-
& > StBoxLayout { spacing: $base_padding; }
.slider-bin {
@@ -58,8 +56,12 @@
padding: $base_padding;
border-radius: 99px;
}
- .quick-toggle-icon { icon-size: $base_icon_size; }
- .icon-button { background-color: transparent; }
+ .quick-toggle-icon {
+ icon-size: $base_icon_size;
+
+ &:ltr { margin-left: $base_padding; }
+ &:rtl { margin-right: $base_padding; }
+ }
}
.quick-toggle-menu {
@@ -100,8 +102,6 @@
.quick-settings-system-item {
& > StBoxLayout { spacing: 2 * $base_padding; }
- .icon-button > StIcon { -st-icon-style: symbolic; }
-
& .power-item {
min-height: 0;
min-width: 0;
diff --git a/js/ui/quickSettings.js b/js/ui/quickSettings.js
index 7a31d561d4..f407414df3 100644
--- a/js/ui/quickSettings.js
+++ b/js/ui/quickSettings.js
@@ -198,7 +198,7 @@ var QuickSlider = GObject.registerClass({
this._menuButton = new St.Button({
child: new St.Icon({icon_name: 'go-next-symbolic'}),
- style_class: 'icon-button',
+ style_class: 'icon-button flat',
can_focus: true,
x_expand: false,
y_expand: true,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]