summaryrefslogtreecommitdiff
path: root/gtk/gtkstyle.c
diff options
context:
space:
mode:
authorMatthias Clasen <maclas@gmx.de>2004-02-19 23:20:07 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-02-19 23:20:07 +0000
commit40983a12941ac5b9a5fae66e3593204ce9fd1656 (patch)
tree3a2a32754717325f8e77fed20defbd3559352dc2 /gtk/gtkstyle.c
parentadd52ebbbf15992a823408123bdbb65d20723284 (diff)
downloadgtk+-40983a12941ac5b9a5fae66e3593204ce9fd1656.tar.gz
Make the paned handles gray when the the widget is_focus() but not
Fri Feb 20 00:21:38 2004 Matthias Clasen <maclas@gmx.de> * gtk/gtkstyle.c (gtk_default_draw_handle): (gtk_default_draw_box): Make the paned handles gray when the the widget is_focus() but not HAS_FOCUS(). (#122751, Soeren Sandmann)
Diffstat (limited to 'gtk/gtkstyle.c')
-rw-r--r--gtk/gtkstyle.c37
1 files changed, 31 insertions, 6 deletions
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c
index 0bdb73ed64..6197780dad 100644
--- a/gtk/gtkstyle.c
+++ b/gtk/gtkstyle.c
@@ -3365,13 +3365,21 @@ gtk_default_draw_box (GtkStyle *style,
if (!style->bg_pixmap[state_type] ||
GDK_IS_PIXMAP (window))
{
+ GdkGC *gc = style->bg_gc[state_type];
+
+ if (state_type == GTK_STATE_SELECTED && strcmp (detail, "paned") == 0)
+ {
+ if (!GTK_WIDGET_HAS_FOCUS (widget))
+ gc = style->base_gc[GTK_STATE_ACTIVE];
+ }
+
if (area)
- gdk_gc_set_clip_rectangle (style->bg_gc[state_type], area);
+ gdk_gc_set_clip_rectangle (gc, area);
- gdk_draw_rectangle (window, style->bg_gc[state_type], TRUE,
+ gdk_draw_rectangle (window, gc, TRUE,
x, y, width, height);
if (area)
- gdk_gc_set_clip_rectangle (style->bg_gc[state_type], NULL);
+ gdk_gc_set_clip_rectangle (gc, NULL);
}
else
gtk_style_apply_default_background (style, window,
@@ -4750,6 +4758,7 @@ gtk_default_draw_handle (GtkStyle *style,
gint xx, yy;
gint xthick, ythick;
GdkGC *light_gc, *dark_gc;
+ GdkGC *free_me = NULL;
GdkRectangle rect;
GdkRectangle dest;
gint intersect;
@@ -4769,7 +4778,19 @@ gtk_default_draw_handle (GtkStyle *style,
xthick = 0;
ythick = 0;
- light_gc = style->light_gc[state_type];
+ if (state_type == GTK_STATE_SELECTED && !GTK_WIDGET_HAS_FOCUS (widget))
+ {
+ GdkColor unfocused_light;
+
+ gtk_style_shade (&style->base[GTK_STATE_ACTIVE], &unfocused_light,
+ LIGHTNESS_MULT);
+
+ light_gc = free_me = gdk_gc_new (window);
+ gdk_gc_set_rgb_fg_color (light_gc, &unfocused_light);
+ }
+ else
+ light_gc = style->light_gc[state_type];
+
dark_gc = style->black_gc;
}
else
@@ -4787,7 +4808,7 @@ gtk_default_draw_handle (GtkStyle *style,
rect.height = height - (ythick * 2);
if (area)
- intersect = gdk_rectangle_intersect (area, &rect, &dest);
+ intersect = gdk_rectangle_intersect (area, &rect, &dest);
else
{
intersect = TRUE;
@@ -4795,7 +4816,7 @@ gtk_default_draw_handle (GtkStyle *style,
}
if (!intersect)
- return;
+ goto out;
gdk_gc_set_clip_rectangle (light_gc, &dest);
gdk_gc_set_clip_rectangle (dark_gc, &dest);
@@ -4821,6 +4842,10 @@ gtk_default_draw_handle (GtkStyle *style,
gdk_gc_set_clip_rectangle (light_gc, NULL);
gdk_gc_set_clip_rectangle (dark_gc, NULL);
+
+ out:
+ if (free_me)
+ g_object_unref (G_OBJECT (free_me));
}
static void