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:
parent
76090c14eb
commit
ea7b29e049
@ -105,24 +105,15 @@ stage {
|
|||||||
&:insensitive { @include button(insensitive);}
|
&:insensitive { @include button(insensitive);}
|
||||||
&:active { @include button(active);}
|
&:active { @include button(active);}
|
||||||
&:checked { @include button(checked);}
|
&:checked { @include button(checked);}
|
||||||
}
|
|
||||||
|
|
||||||
// normal icon-only button
|
&.flat {
|
||||||
%icon_button {
|
@include button(normal, $flat:true);
|
||||||
border-radius: 99px;
|
&:focus { @include button(focus, $flat:true);}
|
||||||
border-style: solid;
|
&:hover { @include button(hover, $flat:true);}
|
||||||
border-width: 1px;
|
&:insensitive { @include button(insensitive, $flat:true);}
|
||||||
font-weight: bold;
|
&:active { @include button(active, $flat:true);}
|
||||||
padding: $base_padding*2;
|
&:checked { @include button(checked, $flat:true);}
|
||||||
|
}
|
||||||
@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; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// buttons in dialogs/notifications
|
// buttons in dialogs/notifications
|
||||||
@ -143,9 +134,9 @@ $bubble_button_radius:$base_border_radius*1.25;
|
|||||||
&:hover { @include button(hover, $c:$bubble_buttons_color);}
|
&:hover { @include button(hover, $c:$bubble_buttons_color);}
|
||||||
&:active { @include button(active, $c:$bubble_buttons_color);}
|
&:active { @include button(active, $c:$bubble_buttons_color);}
|
||||||
&:checked { @include button(checked, $c:$bubble_buttons_color);}
|
&:checked { @include button(checked, $c:$bubble_buttons_color);}
|
||||||
|
|
||||||
&:first-child:ltr {
|
&:first-child:ltr {
|
||||||
border-radius: 0 0 0 $bubble_button_radius;
|
border-radius: 0 0 0 $bubble_button_radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:last-child:ltr {
|
&:last-child:ltr {
|
||||||
|
@ -143,7 +143,7 @@
|
|||||||
//
|
//
|
||||||
// since buttons are all flat an borderless now the mixin is simpler
|
// 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);
|
$button_bg_color: mix($tc, $c, $button_mix_factor);
|
||||||
transition-duration: 100ms;
|
transition-duration: 100ms;
|
||||||
@ -152,6 +152,9 @@
|
|||||||
@if $t==normal {
|
@if $t==normal {
|
||||||
color: $tc;
|
color: $tc;
|
||||||
background-color: $button_bg_color;
|
background-color: $button_bg_color;
|
||||||
|
@if $flat {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
@if $is_highcontrast == "true" {
|
@if $is_highcontrast == "true" {
|
||||||
box-shadow: inset 0 0 0 1px $button_inset_color;
|
box-shadow: inset 0 0 0 1px $button_inset_color;
|
||||||
}
|
}
|
||||||
|
@ -6,5 +6,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.icon-button {
|
.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;
|
||||||
|
}
|
||||||
|
}
|
@ -48,8 +48,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.quick-slider {
|
.quick-slider {
|
||||||
padding: 0 $base_padding;
|
|
||||||
|
|
||||||
& > StBoxLayout { spacing: $base_padding; }
|
& > StBoxLayout { spacing: $base_padding; }
|
||||||
|
|
||||||
.slider-bin {
|
.slider-bin {
|
||||||
@ -58,8 +56,12 @@
|
|||||||
padding: $base_padding;
|
padding: $base_padding;
|
||||||
border-radius: 99px;
|
border-radius: 99px;
|
||||||
}
|
}
|
||||||
.quick-toggle-icon { icon-size: $base_icon_size; }
|
.quick-toggle-icon {
|
||||||
.icon-button { background-color: transparent; }
|
icon-size: $base_icon_size;
|
||||||
|
|
||||||
|
&:ltr { margin-left: $base_padding; }
|
||||||
|
&:rtl { margin-right: $base_padding; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.quick-toggle-menu {
|
.quick-toggle-menu {
|
||||||
@ -100,8 +102,6 @@
|
|||||||
.quick-settings-system-item {
|
.quick-settings-system-item {
|
||||||
& > StBoxLayout { spacing: 2 * $base_padding; }
|
& > StBoxLayout { spacing: 2 * $base_padding; }
|
||||||
|
|
||||||
.icon-button > StIcon { -st-icon-style: symbolic; }
|
|
||||||
|
|
||||||
& .power-item {
|
& .power-item {
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
@ -198,7 +198,7 @@ var QuickSlider = GObject.registerClass({
|
|||||||
|
|
||||||
this._menuButton = new St.Button({
|
this._menuButton = new St.Button({
|
||||||
child: new St.Icon({icon_name: 'go-next-symbolic'}),
|
child: new St.Icon({icon_name: 'go-next-symbolic'}),
|
||||||
style_class: 'icon-button',
|
style_class: 'icon-button flat',
|
||||||
can_focus: true,
|
can_focus: true,
|
||||||
x_expand: false,
|
x_expand: false,
|
||||||
y_expand: true,
|
y_expand: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user