[gtk+] Adwaita: turn $widget_edge into a function



commit c90d8dafd8fc61f8ba63eb32741876c831a4abad
Author: Lapo Calamandrei <calamandrei gmail com>
Date:   Tue Sep 2 20:35:28 2014 +0200

    Adwaita: turn $widget_edge into a function

 gtk/resources/theme/Adwaita/_common.scss  |   20 ++++++++++----------
 gtk/resources/theme/Adwaita/_drawing.scss |   18 ++++++++++--------
 2 files changed, 20 insertions(+), 18 deletions(-)
---
diff --git a/gtk/resources/theme/Adwaita/_common.scss b/gtk/resources/theme/Adwaita/_common.scss
index 5ff5b7d..4b3561d 100644
--- a/gtk/resources/theme/Adwaita/_common.scss
+++ b/gtk/resources/theme/Adwaita/_common.scss
@@ -681,7 +681,7 @@ GtkColorButton.button {
   GtkColorSwatch {
     border-radius: 1.5px;
     box-shadow: inset 0 1px 1px transparentize(black, 0.8),
-                $widget_edge;
+                widget_edge();
     &:backdrop { box-shadow: none; }
   }
 }
@@ -926,7 +926,7 @@ GtkComboBox {
   $_bg: mix($bg_color, $borders_color, 70%);
   background-color: $_bg;
   box-shadow: inset 0 2px 3px -1px mix($borders_color, $_bg, 60%),
-              $widget_edge;
+              widget_edge();
   //FIXME edge would be nice, but doesn't work
   &:backdrop {
     border-color: $backdrop_borders_color;
@@ -1636,7 +1636,7 @@ GtkSwitch {
   font-size: 82%;
   outline-offset: -4px;
   box-shadow: inset 0 1px transparentize(black, 0.9), // needs to be set here
-              $widget_edge;                           // otherwise it gets
+              widget_edge();                          // otherwise it gets
                                                       // clipped
   &.trough {
     // similar to the .scale
@@ -1649,7 +1649,7 @@ GtkSwitch {
       @include progressbar_fill;
       color: white;
       border-color: $selected_borders_color;
-      box-shadow: $widget_edge;
+      box-shadow: widget_edge();
       //text-shadow: 0 1px transparentize($selected_borders_color,0.5);
       text-shadow: 0 1px transparentize($selected_borders_color,0.5),
                    0 0 2px transparentize(white,0.4);
@@ -1659,7 +1659,7 @@ GtkSwitch {
       border-color: $borders_color;
       background-image: none;
       background-color: $insensitive_bg_color;
-      box-shadow: $widget_edge;
+      box-shadow: widget_edge();
       text-shadow: none;
     }
     &:backdrop {
@@ -1890,11 +1890,11 @@ GtkCheckButton.text-button, GtkRadioButton.text-button {
     border-radius: 3px;
     background-color: mix($bg_color,$borders_color,60%);
     box-shadow: inset 1px 1px transparentize(black, 0.9),
-                $widget_edge;
+                widget_edge();
     &.highlight {
       @include progressbar_fill;
       border-color: $selected_borders_color;
-      box-shadow: $widget_edge;
+      box-shadow: widget_edge();
       &.vertical { @include progressbar_fill(vertical); }
       &:backdrop {
          border-color: if($variant=='light', $selected_bg_color,
@@ -1907,7 +1907,7 @@ GtkCheckButton.text-button, GtkRadioButton.text-button {
       border-color: $insensitive_borders_color;
       background-image: none;
       background-color: $insensitive_bg_color;
-      box-shadow: $widget_edge;
+      box-shadow: widget_edge();
     }
     &:backdrop {
       border-color: $backdrop_borders_color;
@@ -2005,7 +2005,7 @@ GtkProgressBar {
     font-size: 82%;
     color: transparentize($fg_color, 0.6);
     box-shadow: inset 1px 1px transparentize(black, 0.9), // needs to be set
-                $widget_edge;                             // here ot it gets
+                widget_edge();                            // here ot it gets
                                                           // clipped
     &:backdrop {
       color: $backdrop_insensitive_color;
@@ -2082,7 +2082,7 @@ GtkProgressBar.trough {
 GtkLevelBar {
   -GtkLevelBar-min-block-width: 34;
   -GtkLevelBar-min-block-height: 3;
-  box-shadow: $widget_edge; // needs to be set here to avoid clipping
+  box-shadow: widget_edge(); // needs to be set here to avoid clipping
 }
 
 GtkLevelBar.vertical {
diff --git a/gtk/resources/theme/Adwaita/_drawing.scss b/gtk/resources/theme/Adwaita/_drawing.scss
index 6244eb8..3c309f3 100644
--- a/gtk/resources/theme/Adwaita/_drawing.scss
+++ b/gtk/resources/theme/Adwaita/_drawing.scss
@@ -2,8 +2,10 @@
 
 // generic drawing of more complex things
 
-$widget_edge: 0 1px $borders_edge; //outer hilight "used" on
-                                   //most widgets
+ function widget_edge($c:$borders_edge) {
+  // outer highlight "used" on most widgets
+  @return 0 1px $c;
+}
 
 @mixin _shadows($shadow1, $shadow2:none, $shadow3:none, $shadow4:none) {
 //
@@ -35,7 +37,7 @@ $widget_edge: 0 1px $borders_edge; //outer hilight "used" on
   background-color: transparent;
   background-image: entry_gradient($base_color);
   $_blank_edge: if($noedge, none, 0 1px transparentize(white,1));
-  $_entry_edge: if($noedge, none, $widget_edge);
+  $_entry_edge: if($noedge, none, widget_edge());
   $_inner_shadows: inset 0 3px mix(black, $base_color, 3%),
                    inset 0 1px mix(black, $base_color, 18%);
   @if $variant == 'dark' {
@@ -159,7 +161,7 @@ $widget_edge: 0 1px $borders_edge; //outer hilight "used" on
     @else { border-color: $borders_color; }
 
     @include _button_text_shadow($tc,$c);
-    $_outsets: if($noedge, none, $widget_edge);
+    $_outsets: if($noedge, none, widget_edge());
     @include _shadows(inset 0 1px $_top_hilight, $_outsets);
   }
 
@@ -176,7 +178,7 @@ $widget_edge: 0 1px $borders_edge; //outer hilight "used" on
                                       $c);
 
     @include _button_text_shadow($tc,lighten($c,4%));
-    $_outsets: if($noedge, none, $widget_edge);
+    $_outsets: if($noedge, none, widget_edge());
     @include _shadows(inset 0 1px $_top_hilight, $_outsets);
   }
 
@@ -191,7 +193,7 @@ $widget_edge: 0 1px $borders_edge; //outer hilight "used" on
                                       darken($c,9%),
                                       darken($c,5%));
     @include _button_text_shadow($tc,darken($c,10%));
-    $_outsets: if($noedge, none, $widget_edge);
+    $_outsets: if($noedge, none, widget_edge());
     @include _shadows(inset 0 1px transparentize(black, 0.93),
                       inset 0 2px 1px -2px transparentize(black,0.4),
                       $_outsets);
@@ -207,7 +209,7 @@ $widget_edge: 0 1px $borders_edge; //outer hilight "used" on
     background-image: linear-gradient(to bottom, $_bg);
     text-shadow: none;
     icon-shadow: none;
-    $_outsets: if($noedge, none, $widget_edge);
+    $_outsets: if($noedge, none, widget_edge());
     // white with 0 alpha to avoid an ugly transition, since no color means
     // black with 0 alpha
     @include _shadows(inset 0 1px transparentize(white,1), $_outsets);
@@ -224,7 +226,7 @@ $widget_edge: 0 1px $borders_edge; //outer hilight "used" on
     color: $insensitive_fg_color;
     border-color: $insensitive_borders_color;
     background-image: linear-gradient(to bottom, mix($_bc, $_bg, 10%), $_bg);
-    $_outsets: if($noedge, none, $widget_edge);
+    $_outsets: if($noedge, none, widget_edge());
     // white with 0 alpha to avoid an ugly transition, since no color means
     // black with 0 alpha
     @include _shadows(inset 0 1px transparentize(white,1), $_outsets);


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