aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLarry Ewing <lewing@ximian.com>2003-08-13 06:39:49 +0800
committerLarry Ewing <lewing@src.gnome.org>2003-08-13 06:39:49 +0800
commit7e917e133504b6740aa128d772fb582f58ba6304 (patch)
tree910a8ba8bf08fff4596f51ab0d025d79c4c80b67
parentb415ae2313ba1f238365fbd261c0e10bbb117c56 (diff)
downloadgsoc2013-evolution-7e917e133504b6740aa128d772fb582f58ba6304.tar
gsoc2013-evolution-7e917e133504b6740aa128d772fb582f58ba6304.tar.gz
gsoc2013-evolution-7e917e133504b6740aa128d772fb582f58ba6304.tar.bz2
gsoc2013-evolution-7e917e133504b6740aa128d772fb582f58ba6304.tar.lz
gsoc2013-evolution-7e917e133504b6740aa128d772fb582f58ba6304.tar.xz
gsoc2013-evolution-7e917e133504b6740aa128d772fb582f58ba6304.tar.zst
gsoc2013-evolution-7e917e133504b6740aa128d772fb582f58ba6304.zip
actually chose the right color to+ composite over when caching the pixmap.
2003-08-12 Larry Ewing <lewing@ximian.com> * e-cell-toggle.c (check_cache): actually chose the right color to+ composite over when caching the pixmap. svn path=/trunk/; revision=22200
-rw-r--r--widgets/table/e-cell-toggle.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c
index 469a41bde4..fbb68ac951 100644
--- a/widgets/table/e-cell-toggle.c
+++ b/widgets/table/e-cell-toggle.c
@@ -135,7 +135,7 @@ check_cache (ECellToggleView *toggle_view, int image_seq, int cache_seq)
if (PIXMAP_CACHE (toggle_view, cache_seq, image_seq) == NULL) {
GdkPixbuf *image = etog->images[image_seq];
GdkPixbuf *flat;
- guint32 color = 0xffffff;
+ GdkColor color;
int width = gdk_pixbuf_get_width (image);
int height = gdk_pixbuf_get_height (image);
@@ -146,35 +146,18 @@ check_cache (ECellToggleView *toggle_view, int image_seq, int cache_seq)
switch (cache_seq % 3) {
case 0:
- color = RGB_COLOR (GTK_WIDGET (toggle_view->canvas)->style->bg [GTK_STATE_SELECTED]);
+ color = GTK_WIDGET (toggle_view->canvas)->style->bg [GTK_STATE_SELECTED];
break;
case 1:
- color = RGB_COLOR (GTK_WIDGET (toggle_view->canvas)->style->bg [GTK_STATE_ACTIVE]);
+ color = GTK_WIDGET (toggle_view->canvas)->style->bg [GTK_STATE_ACTIVE];
break;
case 2:
- color = RGB_COLOR (GTK_WIDGET (toggle_view->canvas)->style->base [GTK_STATE_NORMAL]);
+ color = GTK_WIDGET (toggle_view->canvas)->style->base [GTK_STATE_NORMAL];
break;
}
if (cache_seq >= 3) {
- double r, g, b, h, s, v;
- r = ((color >> 16) & 0xff) / 255.0f;
- g = ((color >> 8) & 0xff) / 255.0f;
- b = (color & 0xff) / 255.0f;
-
- e_rgb_to_hsv (r, g, b, &h, &s, &v);
-
- if (v - 0.05f < 0) {
- v += 0.05f;
- } else {
- v -= 0.05f;
- }
-
- e_hsv_to_rgb (h, s, v, &r, &g, &b);
-
- color = ((((int)(r * 255.0f)) & 0xff) << 16) +
- ((((int)(g * 255.0f)) & 0xff) << 8) +
- (((int)(b * 255.0f)) & 0xff);
+ e_hsv_tweak (&color, 0.0f, 0.0f, -0.07f);
}
flat = gdk_pixbuf_composite_color_simple (image,
@@ -182,7 +165,7 @@ check_cache (ECellToggleView *toggle_view, int image_seq, int cache_seq)
GDK_INTERP_BILINEAR,
255,
1,
- color, color);
+ RGB_COLOR (color), RGB_COLOR (color));
gdk_pixbuf_render_to_drawable (flat, PIXMAP_CACHE (toggle_view, cache_seq, image_seq),
toggle_view->gc,