summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2002-01-07 21:35:02 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-01-07 21:35:02 +0000
commit9ed27d3dcb87fbbdf6991bb4b23dbf1d24039efb (patch)
tree3a7330dea88cc2002ac660919d82154fdd3cd457
parentf36ba88085160867791f73704fb023a165d29752 (diff)
downloadmetacity-9ed27d3dcb87fbbdf6991bb4b23dbf1d24039efb.tar.gz
metacity-9ed27d3dcb87fbbdf6991bb4b23dbf1d24039efb.tar.bz2
make gradient a bit more subtle (don't go to the full background, but to a
2002-01-07 Havoc Pennington <hp@redhat.com> * src/frames.c (meta_frames_expose_event): make gradient a bit more subtle (don't go to the full background, but to a blend of selection and background; put lighter color on top)
-rw-r--r--ChangeLog6
-rw-r--r--src/frames.c13
2 files changed, 17 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e866819..76ef57a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-01-07 Havoc Pennington <hp@redhat.com>
+
+ * src/frames.c (meta_frames_expose_event): make gradient a bit
+ more subtle (don't go to the full background, but to a blend of
+ selection and background; put lighter color on top)
+
2002-01-06 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_notify_focus): put in attempted fix
diff --git a/src/frames.c b/src/frames.c
index 10dd5af..cb93a23 100644
--- a/src/frames.c
+++ b/src/frames.c
@@ -1759,12 +1759,21 @@ meta_frames_expose_event (GtkWidget *widget,
if (flags & META_FRAME_HAS_FOCUS)
{
GdkPixbuf *gradient;
-
+ GdkColor selected_faded;
+ const GdkColor *bg = &widget->style->bg[GTK_STATE_NORMAL];
+
+ /* alpha blend selection color into normal color */
+#define ALPHA 25000
+ selected_faded = widget->style->bg[GTK_STATE_SELECTED];
+ selected_faded.red = selected_faded.red + (((bg->red - selected_faded.red) * ALPHA + 32768) >> 16);
+ selected_faded.green = selected_faded.green + (((bg->green - selected_faded.green) * ALPHA + 32768) >> 16);
+ selected_faded.blue = selected_faded.blue + (((bg->blue - selected_faded.blue) * ALPHA + 32768) >> 16);
+
layout_gc = widget->style->fg_gc[GTK_STATE_SELECTED];
gradient = meta_theme_get_gradient (META_GRADIENT_DIAGONAL,
+ &selected_faded,
&widget->style->bg[GTK_STATE_SELECTED],
- &widget->style->bg[GTK_STATE_NORMAL],
fgeom.title_rect.width,
fgeom.title_rect.height);