summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarina Zhurakhinskaya <marinaz@redhat.com>2009-06-25 14:32:00 -0400
committerMarina Zhurakhinskaya <marinaz@redhat.com>2009-06-25 14:32:00 -0400
commit6d002c893d9bfcb4460b836103d9d8a997fbfcde (patch)
tree3977777d6d7e85b62df9d828a7e0985307e75380
parent5eaed340474d2c88b6bd4855e7ff23a6e8b9b5a1 (diff)
downloadgnome-shell-6d002c893d9bfcb4460b836103d9d8a997fbfcde.tar.gz
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.
-rw-r--r--js/ui/overlay.js10
-rw-r--r--src/shell-global.c18
2 files changed, 15 insertions, 13 deletions
diff --git a/js/ui/overlay.js b/js/ui/overlay.js
index 9dd2a462b..64089ce46 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 964c6126c..46d6052ba 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);