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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2510>
This commit is contained in:
Sam Hewitt 2022-10-13 14:21:17 -02:30 committed by Marge Bot
parent 76090c14eb
commit ea7b29e049
5 changed files with 32 additions and 29 deletions

View File

@ -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 {

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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,