[gnome-shell] Fix up horizontal gradient code and its use



commit 9faf161aae60bf806b848dfdfb8b1d681cc2d878
Author: Marina Zhurakhinskaya <marinaz redhat com>
Date:   Thu Jun 25 14:32:00 2009 -0400

    Fix up horizontal gradient code and its use
    
    Fix up the comments about the horizontal gradient code and use 8x1 texture
    instead of 8x8.
    
    Make sure the values we assign to the three-stop horizontal gradient
    require the use of the three stop gradient, with the middle value not being
    right between the side values.

 js/ui/overlay.js   |   10 +++++-----
 src/shell-global.c |   18 ++++++++++--------
 2 files changed, 15 insertions(+), 13 deletions(-)
---
diff --git a/js/ui/overlay.js b/js/ui/overlay.js
index 9dd2a46..64089ce 100644
--- a/js/ui/overlay.js
+++ b/js/ui/overlay.js
@@ -77,9 +77,9 @@ const STATE_INACTIVE = false;
 
 // The dash has a slightly transparent blue background with a gradient.
 const DASH_LEFT_COLOR = new Clutter.Color();
-DASH_LEFT_COLOR.from_pixel(0x324c6faa);
+DASH_LEFT_COLOR.from_pixel(0x324c6fbb);
 const DASH_MIDDLE_COLOR = new Clutter.Color();
-DASH_MIDDLE_COLOR.from_pixel(0x324c6fbb);
+DASH_MIDDLE_COLOR.from_pixel(0x324c6faa);
 const DASH_RIGHT_COLOR = new Clutter.Color();
 DASH_RIGHT_COLOR.from_pixel(0x324c6fcc);
 
@@ -90,11 +90,11 @@ const DASH_BORDER_WIDTH = 2;
 
 // The results and details panes have a somewhat transparent blue background with a gradient.
 const PANE_LEFT_COLOR = new Clutter.Color();
-PANE_LEFT_COLOR.from_pixel(0x324c6ff0);
+PANE_LEFT_COLOR.from_pixel(0x324c6ff4);
 const PANE_MIDDLE_COLOR = new Clutter.Color();
-PANE_MIDDLE_COLOR.from_pixel(0x324c6ff4);
+PANE_MIDDLE_COLOR.from_pixel(0x324c6ffa);
 const PANE_RIGHT_COLOR = new Clutter.Color();
-PANE_RIGHT_COLOR.from_pixel(0x324c6ff8);
+PANE_RIGHT_COLOR.from_pixel(0x324c6ff4);
 
 const SHADOW_COLOR = new Clutter.Color();
 SHADOW_COLOR.from_pixel(0x00000033);
diff --git a/src/shell-global.c b/src/shell-global.c
index 964c612..46d6052 100644
--- a/src/shell-global.c
+++ b/src/shell-global.c
@@ -935,10 +935,10 @@ shell_global_create_vertical_gradient (ClutterColor *top,
 
 /**
  * shell_global_create_horizontal_gradient:
- * @left: the color at the top
- * @right: the color at the bottom
+ * @left: the color on the left
+ * @right: the color on the right
  *
- * Creates a vertical gradient actor.
+ * Creates a horizontal gradient actor.
  *
  * Return value: (transfer none): a #ClutterCairoTexture actor with the
  *               gradient. The texture actor is floating, hence (transfer none).
@@ -951,12 +951,14 @@ shell_global_create_horizontal_gradient (ClutterColor *left,
   cairo_t *cr;
   cairo_pattern_t *pattern;
 
-  /* Draw the gradient on an 8x8 pixel texture. Because the gradient is drawn
-   * from the uppermost to the lowermost row, after stretching 1/16 of the
-   * texture height has the top color and 1/16 has the bottom color. The 8
-   * pixel width is chosen for reasons related to graphics hardware internals.
+  /* Draw the gradient on an 8x1 pixel texture. Because the gradient is drawn
+   * from the left to the right column, after stretching 1/16 of the
+   * texture width has the left side color and 1/16 has the right side color. 
+   * There is no reason to use the 8 pixel height that would be similar to the
+   * reason we are using the 8 pixel width for the vertical gradient, so we
+   * are just using the 1 pixel height instead.
    */
-  texture = CLUTTER_CAIRO_TEXTURE (clutter_cairo_texture_new (8, 8));
+  texture = CLUTTER_CAIRO_TEXTURE (clutter_cairo_texture_new (8, 1));
   cr = clutter_cairo_texture_create (texture);
 
   pattern = cairo_pattern_create_linear (0, 0, 8, 0);



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