From bbbcc724606355904d62afbacd4a72a5ab1a4d01 Mon Sep 17 00:00:00 2001 From: Jakub Steiner Date: Fri, 20 Nov 2020 11:26:13 +0100 Subject: [PATCH] Adwaita,HC: use dark prelights - increase :hover visibility by going darker rather than lighter puppies died. Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3380 --- gtk/theme/Adwaita/_colors.scss | 1 - gtk/theme/Adwaita/_common.scss | 35 ++++++++++++++++++++++----------- gtk/theme/Adwaita/_drawing.scss | 30 ++++++---------------------- 3 files changed, 29 insertions(+), 37 deletions(-) diff --git a/gtk/theme/Adwaita/_colors.scss b/gtk/theme/Adwaita/_colors.scss index 507286dafe..bf183a7866 100644 --- a/gtk/theme/Adwaita/_colors.scss +++ b/gtk/theme/Adwaita/_colors.scss @@ -38,7 +38,6 @@ $osd_insensitive_fg_color: mix($osd_fg_color, opacify($osd_bg_color, 1), 50%); $osd_borders_color: transparentize(black, 0.3); $sidebar_bg_color: mix($bg_color, $base_color, 50%); -$base_hover_color: transparentize($fg_color, 0.95); $tooltip_borders_color: transparentize(white, 0.9); $shadow_color: transparentize(black, 0.9); diff --git a/gtk/theme/Adwaita/_common.scss b/gtk/theme/Adwaita/_common.scss index ad3b06788d..19812ded36 100644 --- a/gtk/theme/Adwaita/_common.scss +++ b/gtk/theme/Adwaita/_common.scss @@ -1033,7 +1033,7 @@ spinbutton { &:hover { color: $fg_color; - background-color: $base_hover_color; + background-color: darken($bg_color,5%); } &:disabled { @@ -1076,7 +1076,7 @@ spinbutton { color: $osd_fg_color; border-color: transparentize(opacify($osd_borders_color, 1), 0.5); - background-color: transparentize($osd_fg_color, 0.9); + background-color: darken($osd_bg_color,10%); -gtk-icon-shadow: 0 1px black; box-shadow: none; } @@ -2138,7 +2138,7 @@ notebook { &:hover { color: $fg_color; - background-color: darken($bg_color,4%); + background-color: darken($dark_fill,4%); &.reorderable-page { border-color: transparentize($borders_color, 0.7); @@ -2370,12 +2370,7 @@ switch { > image { color: transparent; } /* only show i / o for the accessible theme */ &:hover > slider { - @if $variant == 'light' { - @include button(hover-alt, $edge: $shadow_color); - } - @else { - @include button(hover-alt, $c: lighten($bg_color,6%), $edge: $shadow_color); - } + @include button(hover, $edge: $shadow_color); } &:checked > slider { border: 1px solid $switch_borders_color; } @@ -2675,7 +2670,7 @@ scale { transition: $button_transition; transition-property: background, border, box-shadow; - &:hover { @include button(hover-alt, $edge: $shadow_color); } + &:hover { @include button(hover, $edge: $shadow_color); } &:active { border-color: $selected_borders_color; } @@ -3565,6 +3560,10 @@ filechooserbutton:drop(active) { } stacksidebar { + //not a regular list + list.separators:not(.horizontal) > row:not(.separator) { + border-bottom: none; + } row { padding: 10px 4px; @@ -3575,8 +3574,20 @@ stacksidebar { &.needs-attention > label { @extend %needs_attention; - - background-size: 6px 6px, 0 0; + background-size: 6px 6px, 0 0; + } + &:selected { + background-color: $menu_selected_color; + border-radius: $menu_radius; + color: $fg_color; + } + &:selected:hover:dir(ltr), &:selected:hover:dir(rtl) { + background-color: darken($menu_selected_color,5%); + } + &:focus:focus-visible { + outline-width: 0; + background-color: $selected_bg_color; + color: $selected_fg_color; } } } diff --git a/gtk/theme/Adwaita/_drawing.scss b/gtk/theme/Adwaita/_drawing.scss index e252d4d022..78984e4409 100644 --- a/gtk/theme/Adwaita/_drawing.scss +++ b/gtk/theme/Adwaita/_drawing.scss @@ -189,12 +189,12 @@ border-color: if($c != $bg_color, _border_color($c), $borders_color); border-bottom-color: if($c != $bg_color, _border_color($c, true), $alt_borders_color); @if $variant == 'light' { - background-image: linear-gradient(to top, $c, lighten($c, 1%) 1px); - @include _shadows(inset 0 1px _button_hilight_color(lighten($c, 6%)), $_button_edge, $_button_shadow); + background-image: linear-gradient(to top, darken($c,16%), darken($c,8%) 1px); + @include _shadows(inset 0 1px darken($c,1%), $_button_edge, $_button_shadow); } @else { - background-image: linear-gradient(to top, darken($c,1%), lighten($c, 1%) 1px); - @include _shadows(inset 0 1px _button_hilight_color(darken($c, 2%)), $_button_edge, $_button_shadow); + background-image: linear-gradient(to top, darken($c,4%) 20%, darken($c, 3%) 90%); + @include _shadows(inset 0 1px $c, $_button_edge, $_button_shadow); } } @@ -217,24 +217,6 @@ } } - @else if $t==hover-alt { - // - // hovered button alternative look - // - color: $tc; - border-color: if($c != $bg_color, _border_color($c, true), $alt_borders_color); - @if $variant == 'light' { - background-image: linear-gradient(to bottom, lighten($c, 9%) 10%, lighten($c, 4%) 90%); - @include _shadows(inset 0 1px _button_hilight_color(lighten($c, 6%)), - $_button_edge, $_button_shadow); - } - @else { - background-image: linear-gradient(to bottom, $c 20%, darken($c, 4%) 90%); - @include _shadows(inset 0 1px $_hilight_color, - $_button_edge, $_button_shadow); - } - } - @else if $t==active { // // pushed button @@ -360,7 +342,7 @@ // // active osd button // - $_bg: if($c != $bg_color, transparentize($c, 0.3), lighten($osd_bg_color, 12%)); + $_bg: if($c != $bg_color, transparentize($c, 0.3), darken($osd_bg_color, 10%)); color: white; border-color: $osd_borders_color; @@ -376,7 +358,7 @@ // // active osd button // - $_bg: if($c != $bg_color, $c, $osd_borders_color); + $_bg: if($c != $bg_color, $c, darken($osd_bg_color, 20%)); color: white; border-color: $osd_borders_color;