[libadwaita/wip/exalm/oapcity: 1/6] stylesheet: Extract $disabled_opacity




commit 21b98954221d7f7a4df64b0e74cac7b606fdcb8f
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Thu Oct 21 23:10:05 2021 +0500

    stylesheet: Extract $disabled_opacity
    
    Allow to control it all at once instead of hardcoding 0.5 everywhere.

 src/stylesheet/_colors.scss                | 1 +
 src/stylesheet/widgets/_buttons.scss       | 2 +-
 src/stylesheet/widgets/_checks.scss        | 2 +-
 src/stylesheet/widgets/_color-chooser.scss | 2 +-
 src/stylesheet/widgets/_entries.scss       | 2 +-
 src/stylesheet/widgets/_expanders.scss     | 2 +-
 src/stylesheet/widgets/_labels.scss        | 2 +-
 src/stylesheet/widgets/_level-bar.scss     | 2 +-
 src/stylesheet/widgets/_links.scss         | 2 +-
 src/stylesheet/widgets/_lists.scss         | 6 +++---
 src/stylesheet/widgets/_menus.scss         | 2 +-
 src/stylesheet/widgets/_misc.scss          | 2 +-
 src/stylesheet/widgets/_progress-bar.scss  | 2 +-
 src/stylesheet/widgets/_scale.scss         | 2 +-
 src/stylesheet/widgets/_spinner.scss       | 2 +-
 src/stylesheet/widgets/_switch.scss        | 2 +-
 src/stylesheet/widgets/_trees.scss         | 2 +-
 17 files changed, 19 insertions(+), 18 deletions(-)
---
diff --git a/src/stylesheet/_colors.scss b/src/stylesheet/_colors.scss
index 6226ee50..eb2125f7 100644
--- a/src/stylesheet/_colors.scss
+++ b/src/stylesheet/_colors.scss
@@ -79,6 +79,7 @@ $drop_target_color: $accent_bg_color;
 //special cased widget colors
 $focus_border_color:  gtkalpha($accent_bg_color, 0.5);
 $dim_label_opacity: 0.55;
+$disabled_opacity: 0.5;
 
 // High Contrast color overrides
 @if $contrast == 'high' {
diff --git a/src/stylesheet/widgets/_buttons.scss b/src/stylesheet/widgets/_buttons.scss
index da0e9ab2..66e67f95 100644
--- a/src/stylesheet/widgets/_buttons.scss
+++ b/src/stylesheet/widgets/_buttons.scss
@@ -48,7 +48,7 @@ button {
     }
 
     &:disabled {
-      filter: opacity(.5);
+      filter: opacity($disabled_opacity);
 
       label {
         filter: none;
diff --git a/src/stylesheet/widgets/_checks.scss b/src/stylesheet/widgets/_checks.scss
index 091494f4..4d500261 100644
--- a/src/stylesheet/widgets/_checks.scss
+++ b/src/stylesheet/widgets/_checks.scss
@@ -45,7 +45,7 @@ radio {
   }
 
   &:disabled {
-    filter: opacity(.5);
+    filter: opacity($disabled_opacity);
   }
 }
 
diff --git a/src/stylesheet/widgets/_color-chooser.scss b/src/stylesheet/widgets/_color-chooser.scss
index e8f9698a..e40b1a9d 100644
--- a/src/stylesheet/widgets/_color-chooser.scss
+++ b/src/stylesheet/widgets/_color-chooser.scss
@@ -93,7 +93,7 @@ colorswatch {
   }
 
   &:disabled {
-    filter: opacity(.5);
+    filter: opacity($disabled_opacity);
   }
 
   &#editor-color-sample {
diff --git a/src/stylesheet/widgets/_entries.scss b/src/stylesheet/widgets/_entries.scss
index c37b1c22..a55c29c4 100644
--- a/src/stylesheet/widgets/_entries.scss
+++ b/src/stylesheet/widgets/_entries.scss
@@ -36,7 +36,7 @@ entry {
       }
     }
 
-    &:disabled { filter: opacity(.5); }
+    &:disabled { filter: opacity($disabled_opacity); }
 
     // entry error and warning style
     @each $e_type, $e_color in (error, $error_color),
diff --git a/src/stylesheet/widgets/_expanders.scss b/src/stylesheet/widgets/_expanders.scss
index 658271fc..fec19d2e 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 { filter: opacity(.5); }
+  &:disabled { filter: opacity($disabled_opacity); }
 
   &:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
 }
diff --git a/src/stylesheet/widgets/_labels.scss b/src/stylesheet/widgets/_labels.scss
index a3cf51dd..d518262d 100644
--- a/src/stylesheet/widgets/_labels.scss
+++ b/src/stylesheet/widgets/_labels.scss
@@ -6,7 +6,7 @@ label {
   }
 
   &:disabled {
-    filter: opacity(0.5);
+    filter: opacity($disabled_opacity);
   }
 
   &.error {
diff --git a/src/stylesheet/widgets/_level-bar.scss b/src/stylesheet/widgets/_level-bar.scss
index a4367283..e3513834 100644
--- a/src/stylesheet/widgets/_level-bar.scss
+++ b/src/stylesheet/widgets/_level-bar.scss
@@ -3,7 +3,7 @@ $_levelbar_border_radius: 99px;
 
 levelbar {
   &:disabled {
-    filter: opacity(.5);
+    filter: opacity($disabled_opacity);
   }
 
   &.horizontal {
diff --git a/src/stylesheet/widgets/_links.scss b/src/stylesheet/widgets/_links.scss
index 756eab69..a3a5fba6 100644
--- a/src/stylesheet/widgets/_links.scss
+++ b/src/stylesheet/widgets/_links.scss
@@ -15,7 +15,7 @@ link {
     color: $link_color;
   }
 
-  &:disabled { color: gtkalpha(currentColor, 0.5); }
+  &:disabled { color: gtkalpha(currentColor, $disabled_opacity); }
 }
 
 link {
diff --git a/src/stylesheet/widgets/_lists.scss b/src/stylesheet/widgets/_lists.scss
index 5c40a977..150367b6 100644
--- a/src/stylesheet/widgets/_lists.scss
+++ b/src/stylesheet/widgets/_lists.scss
@@ -84,7 +84,7 @@ row {
     min-height: 50px;
 
     > .icon:disabled {
-      filter: opacity(.5);
+      filter: opacity($disabled_opacity);
     }
 
     > box.title {
@@ -100,7 +100,7 @@ row {
 
 row.combo {
   image.dropdown-arrow:disabled {
-    filter: opacity(.5);
+    filter: opacity($disabled_opacity);
   }
 
   listview.inline {
@@ -203,7 +203,7 @@ row.expander {
   }
 
   image.expander-row-arrow:disabled {
-    filter: opacity(.5);
+    filter: opacity($disabled_opacity);
   }
 }
 
diff --git a/src/stylesheet/widgets/_menus.scss b/src/stylesheet/widgets/_menus.scss
index d275aafd..f8543af1 100644
--- a/src/stylesheet/widgets/_menus.scss
+++ b/src/stylesheet/widgets/_menus.scss
@@ -134,7 +134,7 @@ popover.menu {
       &:hover { background: none; }
 
       &:disabled {
-        filter: opacity(0.5);
+        filter: opacity($disabled_opacity);
       }
 
       &.left { -gtk-icon-source: -gtk-icontheme("go-previous-symbolic"); }
diff --git a/src/stylesheet/widgets/_misc.scss b/src/stylesheet/widgets/_misc.scss
index 2c88d1b2..80c1f0d2 100644
--- a/src/stylesheet/widgets/_misc.scss
+++ b/src/stylesheet/widgets/_misc.scss
@@ -90,7 +90,7 @@ statuspage {
         }
 
         &:disabled {
-          opacity: .5;
+          opacity: $disabled_opacity;
         }
 
         &:not(:last-child) {
diff --git a/src/stylesheet/widgets/_progress-bar.scss b/src/stylesheet/widgets/_progress-bar.scss
index 9eccac5d..1f4a6139 100644
--- a/src/stylesheet/widgets/_progress-bar.scss
+++ b/src/stylesheet/widgets/_progress-bar.scss
@@ -21,7 +21,7 @@ progressbar {
   }
 
   &:disabled {
-    filter: opacity(.5);
+    filter: opacity($disabled_opacity);
   }
 
   > trough {
diff --git a/src/stylesheet/widgets/_scale.scss b/src/stylesheet/widgets/_scale.scss
index 6a232666..698afd32 100644
--- a/src/stylesheet/widgets/_scale.scss
+++ b/src/stylesheet/widgets/_scale.scss
@@ -67,7 +67,7 @@ scale {
   }
 
   &:disabled {
-    filter: opacity(.5);
+    filter: opacity($disabled_opacity);
 
     > trough > slider {
       box-shadow: 0 2px 4px transparent;
diff --git a/src/stylesheet/widgets/_spinner.scss b/src/stylesheet/widgets/_spinner.scss
index ee38a799..ab1f0202 100644
--- a/src/stylesheet/widgets/_spinner.scss
+++ b/src/stylesheet/widgets/_spinner.scss
@@ -11,6 +11,6 @@ spinner {
     opacity: 1;
     animation: spin 1s linear infinite;
 
-    &:disabled { opacity: 0.5; }
+    &:disabled { opacity: $disabled_opacity; }
   }
 }
diff --git a/src/stylesheet/widgets/_switch.scss b/src/stylesheet/widgets/_switch.scss
index 9fa02a0a..d5355b78 100644
--- a/src/stylesheet/widgets/_switch.scss
+++ b/src/stylesheet/widgets/_switch.scss
@@ -18,7 +18,7 @@ switch {
   @include focus-ring($offset: 1px, $outer: true);
 
   &:disabled {
-    filter: opacity(0.5);
+    filter: opacity($disabled_opacity);
   }
 
   > slider {
diff --git a/src/stylesheet/widgets/_trees.scss b/src/stylesheet/widgets/_trees.scss
index 4989eeea..1d331dfb 100644
--- a/src/stylesheet/widgets/_trees.scss
+++ b/src/stylesheet/widgets/_trees.scss
@@ -50,7 +50,7 @@ treeview.view {
 
     &:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
 
-    &:disabled { color: gtkalpha(currentColor, 0.5); }
+    &:disabled { color: gtkalpha(currentColor, $disabled_opacity); }
   }
 
   &.progressbar { // progress bar in treeviews


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