[gnome-themes-standard] rationalization and preparatory work



commit d36573c71f18d100255a6ca1b289ea23c12e24d2
Author: Lapo Calamandrei <calamandrei gmail com>
Date:   Tue May 27 18:05:26 2014 +0200

    rationalization and preparatory work
    
      - renamed $noshadow to $noedge in button drawing mixin
      - renamed $widget_bottom_hilight to $widget_edge
      - used named var for vertical spinners buttons invocations
      - introduced a temporary gross hack in the vertical spinner
        before rewriting it

 themes/Adwaita/gtk-3.0/_common.scss  |   13 +++++---
 themes/Adwaita/gtk-3.0/_drawing.scss |   48 +++++++++++++++++----------------
 2 files changed, 33 insertions(+), 28 deletions(-)
---
diff --git a/themes/Adwaita/gtk-3.0/_common.scss b/themes/Adwaita/gtk-3.0/_common.scss
index e310d93..6c7c124 100644
--- a/themes/Adwaita/gtk-3.0/_common.scss
+++ b/themes/Adwaita/gtk-3.0/_common.scss
@@ -375,10 +375,10 @@ GtkColorButton.button { padding: 4px; } // Uniform padding on the GtkColorButton
     .button {
       &:first-child {
         border-radius: 3px 3px 0 0;
-        @include button(normal,$bg_color,$fg_color,true);
-        &:active { @include button(active,$bg_color,$fg_color,true); }
-        &:insensitive { @include button(insensitive,$bg_color,$fg_color,true); }
-        &:hover { @include button(hover,$bg_color,$fg_color,true); }
+        @include button(normal, $noedge: true);
+        &:active { @include button(active, $noedge: true); }
+        &:insensitive { @include button(insensitive, $noedge: true); }
+        &:hover { @include button(hover, $noedge: true); }
         &:backdrop { @include button(backdrop); }
         &:backdrop:insensitive { @include button(backdrop-insensitive); }
       }
@@ -391,8 +391,11 @@ GtkColorButton.button { padding: 4px; } // Uniform padding on the GtkColorButton
         &:backdrop { @include button(backdrop); }
         &:backdrop:insensitive { @include button(backdrop-insensitive); }
       }
+      // FIXME this is a temporary gross hack
+      &.button.button.button:first-child { border-bottom-width: 0; }
+      &.button.button.button:last-child { border-top-width: 0; }
     }
-    &.entry { border-radius: 0; border-width: 0 1px 0 1px;}
+    &.entry { border-radius: 0; }
   }
 }
 
diff --git a/themes/Adwaita/gtk-3.0/_drawing.scss b/themes/Adwaita/gtk-3.0/_drawing.scss
index 81633dd..9fdf048 100644
--- a/themes/Adwaita/gtk-3.0/_drawing.scss
+++ b/themes/Adwaita/gtk-3.0/_drawing.scss
@@ -2,8 +2,20 @@
 
 // generic drawing of more complex things
 
-$widget_bottom_hilight: 0 1px $borders_edge; //outer hilight "used" on
+$widget_edge: 0 1px $borders_edge; //outer hilight "used" on
                                              //most widgets, FIXME 1px
+
+ mixin _shadows($shadow1, $shadow2:false, $shadow3:false, $shadow4:false) {
+//
+// Helper function to stack up to 4 box-shadows;
+//
+  @if $shadow2 {box-shadow: $shadow1, $shadow2;}
+  @else if $shadow3 {box-shadow: $shadow1, $shadow2, $shadow3;}
+  @else if $shadow4 {box-shadow: $shadow1, $shadow2, $shadow3, shadow4;}
+  @else { box-shadow: $shadow1; }
+}
+
+
 // buttons
 
 @mixin _button_border_color ($c) { // helper function to draw borders
@@ -34,24 +46,14 @@ $widget_bottom_hilight: 0 1px $borders_edge; //outer hilight "used" on
   }
 }
 
- mixin _shadows($shadow1, $shadow2:false, $shadow3:false, $shadow4:false) {
-//
-// Helper function to stack up to 4 box-shadows;
-//
-  @if $shadow2 {box-shadow: $shadow1, $shadow2;}
-  @else if $shadow3 {box-shadow: $shadow1, $shadow2, $shadow3;}
-  @else if $shadow4 {box-shadow: $shadow1, $shadow2, $shadow3, shadow4;}
-  @else { box-shadow: $shadow1; }
-}
-
- mixin button($t, $c:$bg_color, $tc:$fg_color, $noshadow:false ) {
+ mixin button($t, $c:$bg_color, $tc:$fg_color, $noedge:false ) {
 //
 // Button drawing function
 //
 // $t:  button type,
 // $c:  base button color for colored* types
 // $tc: optional text color for colored* types
-// $noshadow: set to true not to draw the bottom hilight
+// $noedge: set to true not to draw the bottom hilight
 //
 // possible $t values:
 // normal, hover, active, insensitive, insensitive-active,
@@ -83,9 +85,9 @@ $widget_bottom_hilight: 0 1px $borders_edge; //outer hilight "used" on
     @else { border-color: $borders_color; }
 
     @include _button_text_shadow($tc,$c);
-    @if $noshadow { box-shadow: inset 0 1px $_top_hilight; }
+    @if $noedge { box-shadow: inset 0 1px $_top_hilight; }
     @else {
-      @include _shadows(inset 0 1px $_top_hilight, $widget_bottom_hilight);
+      @include _shadows(inset 0 1px $_top_hilight, $widget_edge);
     }
   }
 
@@ -98,9 +100,9 @@ $widget_bottom_hilight: 0 1px $borders_edge; //outer hilight "used" on
                                       $c);
 
     @include _button_text_shadow($tc,lighten($c,4%));
-    @if $noshadow { box-shadow: inset 0 1px $_top_hilight; }
+    @if $noedge { box-shadow: inset 0 1px $_top_hilight; }
     @else {
-      @include _shadows(inset 0 1px $_top_hilight, $widget_bottom_hilight);
+      @include _shadows(inset 0 1px $_top_hilight, $widget_edge);
     }
   }
 
@@ -120,12 +122,12 @@ $widget_bottom_hilight: 0 1px $borders_edge; //outer hilight "used" on
                                         darken($c,5%) 3%);
     }
     @include _button_text_shadow($tc,darken($c,10%));
-    @if $noshadow {
+    @if $noedge {
       box-shadow: inset 0 2px 3px -1px transparentize(black,0.7);
     }
     @else {
       @include _shadows(inset 0 2px 3px -1px transparentize(black,0.7),
-                        $widget_bottom_hilight);
+                        $widget_edge);
     }
   }
   @else if $t==insensitive {
@@ -137,14 +139,14 @@ $widget_bottom_hilight: 0 1px $borders_edge; //outer hilight "used" on
     background-image: none;
     text-shadow: none;
     icon-shadow: none;
-    @if $noshadow {
+    @if $noedge {
       // white with 0 alpha to avoid an ugly transition, since no color means
       // black with 0 alpha
       box-shadow: inset 0 1px transparentize(white,1);
     }
     @else {
       @include _shadows(inset 0 1px transparentize(white,1),
-                        $widget_bottom_hilight);
+                        $widget_edge);
     }
   }
   @else if $t==insensitive-active {
@@ -156,14 +158,14 @@ $widget_bottom_hilight: 0 1px $borders_edge; //outer hilight "used" on
     background-image: linear-gradient(to bottom,
                         transparentize($insensitive_borders_color,.8));
                         //FIXME? better to use mix() probably
-    @if $noshadow {
+    @if $noedge {
       // white with 0 alpha to avoid an ugly transition, since no color means
       // black with 0 alpha
       box-shadow: inset 0 1px transparentize(white,1);
     }
     @else {
       @include _shadows(inset 0 1px transparentize(white,1),
-                        $widget_bottom_hilight);
+                        $widget_edge);
     }
   }
 


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