[libadwaita/wip/exalm/recoloring-fixes: 4/33] stylesheet: Stop using insensitive_[bf]g_color




commit 9b11001b098d43cb78537464cb7fae5870b04154
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Wed Sep 1 02:47:17 2021 +0500

    stylesheet: Stop using insensitive_[bf]g_color

 src/stylesheet/_colors-public.scss     | 4 ++--
 src/stylesheet/_colors.scss            | 8 --------
 src/stylesheet/_drawing.scss           | 4 +---
 src/stylesheet/widgets/_expanders.scss | 2 +-
 src/stylesheet/widgets/_lists.scss     | 2 +-
 src/stylesheet/widgets/_menus.scss     | 5 -----
 src/stylesheet/widgets/_views.scss     | 4 ++--
 7 files changed, 7 insertions(+), 22 deletions(-)
---
diff --git a/src/stylesheet/_colors-public.scss b/src/stylesheet/_colors-public.scss
index 517aaa0d..12685670 100644
--- a/src/stylesheet/_colors-public.scss
+++ b/src/stylesheet/_colors-public.scss
@@ -23,11 +23,11 @@ text widgets and the like base background color */
 
 /*
 base background color of insensitive widgets */
-@define-color insensitive_bg_color #{$insensitive_bg_color};
+@define-color insensitive_bg_color #{gtkmix($bg_color, $base_color, 60%)};
 
 /*
 text foreground color of insensitive widgets */
-@define-color insensitive_fg_color #{$insensitive_fg_color};
+@define-color insensitive_fg_color #{gtkalpha($fg_color, .5)};
 
 /*
 insensitive text widgets and the like base background color */
diff --git a/src/stylesheet/_colors.scss b/src/stylesheet/_colors.scss
index 255c0cf4..e700ddac 100644
--- a/src/stylesheet/_colors.scss
+++ b/src/stylesheet/_colors.scss
@@ -75,10 +75,6 @@ $shadow_color: transparentize(black, 0.9);
 
 $drop_target_color: if($variant == 'light', $green_4, $green_5);
 
-//insensitive state derived colors
-$insensitive_fg_color: mix($fg_color, $bg_color, 50%);
-$insensitive_bg_color: mix($bg_color, $base_color, 60%);
-
 //special cased widget colors
 $focus_border_color:  gtkalpha($accent_bg_color, 0.5);
 $alt_focus_border_color: if($variant == 'light', transparentize(white, 0.2), transparentize(white,0.7));
@@ -94,10 +90,6 @@ $dim_label_opacity: 0.55;
 
   $headerbar_border_color: transparentize($fg_color, .5);
 
-  //insensitive state derived colors
-  $insensitive_fg_color: mix($fg_color, $bg_color, 50%);
-  $insensitive_bg_color: mix($bg_color, $base_color, 60%);
-
   //focus rings
   $focus_border_color: gtkalpha($accent_bg_color, 0.8);
   $alt_focus_border_color: if($variant == 'light', white, transparentize(white,0.4));
diff --git a/src/stylesheet/_drawing.scss b/src/stylesheet/_drawing.scss
index 385d3dc1..4df758e5 100644
--- a/src/stylesheet/_drawing.scss
+++ b/src/stylesheet/_drawing.scss
@@ -58,9 +58,7 @@
     // for the transition to work the number of shadows in different states needs to match, hence the 
transparent shadow here.
   }
   @if $t==insensitive {
-    color: $insensitive_fg_color;
-    border-color: $borders_color;
-    background-color: $insensitive_bg_color;
+    filter: opacity(.5);
   }
   @if $t==osd {
     color: $osd_text_color;
diff --git a/src/stylesheet/widgets/_expanders.scss b/src/stylesheet/widgets/_expanders.scss
index 9c45ad7c..42b76874 100644
--- a/src/stylesheet/widgets/_expanders.scss
+++ b/src/stylesheet/widgets/_expanders.scss
@@ -4,7 +4,7 @@ expander {
   -gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
   &:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); }
 
-  &:disabled { color: $insensitive_fg_color; }
+  &:disabled { opacity: .5; }
 
   &:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
 }
diff --git a/src/stylesheet/widgets/_lists.scss b/src/stylesheet/widgets/_lists.scss
index 48b04d56..123fb996 100644
--- a/src/stylesheet/widgets/_lists.scss
+++ b/src/stylesheet/widgets/_lists.scss
@@ -184,7 +184,7 @@ row.expander {
   }
 
   & image.expander-row-arrow:disabled {
-    color: $insensitive_fg_color;
+    filter: opacity(.5);
   }
 }
 
diff --git a/src/stylesheet/widgets/_menus.scss b/src/stylesheet/widgets/_menus.scss
index 014e0f05..d4476b16 100644
--- a/src/stylesheet/widgets/_menus.scss
+++ b/src/stylesheet/widgets/_menus.scss
@@ -150,11 +150,6 @@ menubar {
       background-color: $view_selected_color;
     }
 
-    &:disabled {
-      color: $insensitive_fg_color;
-      box-shadow: none;
-    }
-
     popover.menu.background > contents {
       padding: $menu-margin;
     }
diff --git a/src/stylesheet/widgets/_views.scss b/src/stylesheet/widgets/_views.scss
index 821ac5bb..e1c22c8d 100644
--- a/src/stylesheet/widgets/_views.scss
+++ b/src/stylesheet/widgets/_views.scss
@@ -4,8 +4,8 @@
   background-color: $base_color;
 
   &:disabled {
-    color: $insensitive_fg_color;
-    background-color: $insensitive_bg_color;
+    color: gtkalpha(currentColor, .5);
+    background-color: gtkmix($bg_color, $base_color, 60%);
   }
 
   &:selected {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]