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)
This commit is contained in:
Havoc Pennington 2002-01-07 21:35:02 +00:00 committed by Havoc Pennington
parent f36ba88085
commit 9ed27d3dcb
2 changed files with 16 additions and 1 deletions

View File

@ -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

View File

@ -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);