[gnome-shell/wip/jimmac/frederik-light] theme: simplify button drawing



commit e4e55f9013ffef06679ca8ea3a30ff1e4f753eaf
Author: Jakub Steiner <jimmac gmail com>
Date:   Thu May 30 11:29:36 2019 +0200

    theme: simplify button drawing
    
    - the original style was built on OSD colors and the conditionals no longer made any sense. In 
Adwaita:gtk the color conditionals special case the color buttons (warning and suggested tinting). This does 
not exist in the shell

 data/theme/gnome-shell-sass/_common.scss  |  6 ++--
 data/theme/gnome-shell-sass/_drawing.scss | 47 +++++++++----------------------
 2 files changed, 16 insertions(+), 37 deletions(-)
---
diff --git a/data/theme/gnome-shell-sass/_common.scss b/data/theme/gnome-shell-sass/_common.scss
index 2fac687fb..649a95b18 100644
--- a/data/theme/gnome-shell-sass/_common.scss
+++ b/data/theme/gnome-shell-sass/_common.scss
@@ -64,9 +64,9 @@ stage {
   border-right-width: 1px;
   @include button(normal, $c:$bubble_bg_color, $tc:$bubble_fg_color);
   &:insensitive { @include button(insensitive, $c:$bubble_bg_color, $tc:$bubble_fg_color); }
-  &:hover { @include button(hover, $c:$bubble_bg_color, $tc:$bubble_fg_color); }
-  &:focus { @include button(focus, $c:$bubble_bg_color, $tc:$bubble_fg_color); }
-  &:active { @include button(active, $c:$bubble_bg_color, $tc:$bubble_fg_color); }
+  &:hover { @include button(hover, $c:$bubble_hover_bg_color, $tc:$bubble_fg_color); }
+  &:focus { @include button(focus, $c:$bubble_hover_bg_color, $tc:$bubble_fg_color); }
+  &:active { @include button(active, $c:$bubble_active_bg_color, $tc:$bubble_active_fg_color); }
   padding: 12px;
   border-top: 1px solid $bubble_borders_color;
 
diff --git a/data/theme/gnome-shell-sass/_drawing.scss b/data/theme/gnome-shell-sass/_drawing.scss
index 12fe656ea..36361c00a 100644
--- a/data/theme/gnome-shell-sass/_drawing.scss
+++ b/data/theme/gnome-shell-sass/_drawing.scss
@@ -108,7 +108,7 @@
   }
 }
 
-@mixin button($t, $c:$osd_bg_color, $tc:$fg_color, $edge: $borders_edge) {
+@mixin button($t, $c:$bg_color, $tc:$fg_color, $edge: $borders_edge) {
 //
 // Button drawing function
 //
@@ -134,9 +134,9 @@
   // normal button
   //
 
-    color: if($bubble_bg_color, $tc, $osd_fg_color);
-    background-color: if($osd_bg_color or $bubble_bg_color, $c, transparentize($c, 0.5));
-    border-color: $osd_borders_color;
+    color: $tc;
+    background-color: $c;
+    border-color: $borders_color;
     box-shadow: none;
     text-shadow: 0 1px black;
     icon-shadow: 0 1px black;
@@ -145,7 +145,7 @@
   //
   // focused button
   //  
-    color: if($bubble_bg_color, $tc, $osd_fg_color);
+    color: $tc;
     text-shadow: 0 1px black;
     icon-shadow: 0 1px black;
     box-shadow: inset 0px 0px 0px 1px $selected_bg_color;
@@ -155,23 +155,9 @@
   //
   // active osd button
   //
-    $_bg: $c;
-    $_fg: white;
-    $_bc: $osd_borders_color;
-    @if $c==$osd_bg_color {
-      $_bg: lighten($osd_bg_color,3%);
-    }
-    @else if $c==$bubble_bg_color {
-      $_bg: $bubble_hover_bg_color;
-      $_fg: $bubble_fg_color;
-      $_bc: $bubble_borders_color;
-    }
-    @else {
-      $_bg: transparentize($c, 0.3);
-    }
-    color: $_fg;
-    border-color: $_bc;
-    background-color: $_bg;
+    color: $tc;
+    border-color: $borders_color;
+    background-color: $c;
     box-shadow: none;
     text-shadow: 0 1px black;
     icon-shadow: 0 1px black;
@@ -181,24 +167,17 @@
   //
   // active osd button
   //
-    color: if($c==$bubble_bg_color, $bubble_active_fg_color, white);
-    border-color: if($c==$bubble_bg_color, $bubble_borders_color, $osd_borders_color);
-    background-color: if($c==$bubble_bg_color, $bubble_active_bg_color, $selected_bg_color);
-    // This should be none, but it's creating some issues with borders, so to
-    // workaround it for now, use inset wich goes through a different code path.
-    // see https://bugzilla.gnome.org/show_bug.cgi?id=752934
+    color: $tc;
+    border-color: $borders_color;
+    background-color: $c;
     text-shadow: none;
     icon-shadow: none;
   }
   @else if $t==insensitive {
-  //
-  // insensitive osd button
-  //
-    $_bg: transparentize(mix($insensitive_fg_color,if($c==$bubble_bg_color, $bubble_bg_color, 
$osd_bg_color), 20%),0.3);
 
     color: $insensitive_fg_color;
-    border-color: if($c==$bubble_bg_color, $bubble_borders_color, $osd_borders_color);
-    background-color: $_bg;
+    border-color: $insensitive_borders_color;
+    background-color: $insensitive_bg_color;
     box-shadow: none;
     text-shadow: none;
     icon-shadow: none;


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