]> Pileus Git - ~andy/gtk/commitdiff
Make the paned handles gray when the the widget is_focus() but not
authorMatthias Clasen <maclas@gmx.de>
Thu, 19 Feb 2004 23:20:07 +0000 (23:20 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Thu, 19 Feb 2004 23:20:07 +0000 (23:20 +0000)
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)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkstyle.c

index 311daed66d9ffcc56871772a206abfbe9f155047..21fa0cfb46c02e65c8e33091a4ff945e063fb6dd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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)
+
 Thu Feb 19 23:41:06 2004  Matthias Clasen  <maclas@gmx.de>
 
        Fixes for #82099:
@@ -6,8 +12,8 @@ Thu Feb 19 23:41:06 2004  Matthias Clasen  <maclas@gmx.de>
        and "Gtk/MenuImages" and map them to "gtk-button-images" and 
        "gtk-menu-images".
 
-       * gtk/gtkimagemenuitem.c: Add a boolean setting "gtk-menu-images" and use
-       it to set the visibility of the embedded image.
+       * gtk/gtkimagemenuitem.c: Add a boolean setting "gtk-menu-images" and 
+       use it to set the visibility of the embedded image.
 
        * gtk/gtkbutton.c: Add a boolean setting "gtk-button-images" and use
        it to set the visibility of an embedded image.
index 311daed66d9ffcc56871772a206abfbe9f155047..21fa0cfb46c02e65c8e33091a4ff945e063fb6dd 100644 (file)
@@ -1,3 +1,9 @@
+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)
+
 Thu Feb 19 23:41:06 2004  Matthias Clasen  <maclas@gmx.de>
 
        Fixes for #82099:
@@ -6,8 +12,8 @@ Thu Feb 19 23:41:06 2004  Matthias Clasen  <maclas@gmx.de>
        and "Gtk/MenuImages" and map them to "gtk-button-images" and 
        "gtk-menu-images".
 
-       * gtk/gtkimagemenuitem.c: Add a boolean setting "gtk-menu-images" and use
-       it to set the visibility of the embedded image.
+       * gtk/gtkimagemenuitem.c: Add a boolean setting "gtk-menu-images" and 
+       use it to set the visibility of the embedded image.
 
        * gtk/gtkbutton.c: Add a boolean setting "gtk-button-images" and use
        it to set the visibility of an embedded image.
index 311daed66d9ffcc56871772a206abfbe9f155047..21fa0cfb46c02e65c8e33091a4ff945e063fb6dd 100644 (file)
@@ -1,3 +1,9 @@
+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)
+
 Thu Feb 19 23:41:06 2004  Matthias Clasen  <maclas@gmx.de>
 
        Fixes for #82099:
@@ -6,8 +12,8 @@ Thu Feb 19 23:41:06 2004  Matthias Clasen  <maclas@gmx.de>
        and "Gtk/MenuImages" and map them to "gtk-button-images" and 
        "gtk-menu-images".
 
-       * gtk/gtkimagemenuitem.c: Add a boolean setting "gtk-menu-images" and use
-       it to set the visibility of the embedded image.
+       * gtk/gtkimagemenuitem.c: Add a boolean setting "gtk-menu-images" and 
+       use it to set the visibility of the embedded image.
 
        * gtk/gtkbutton.c: Add a boolean setting "gtk-button-images" and use
        it to set the visibility of an embedded image.
index 311daed66d9ffcc56871772a206abfbe9f155047..21fa0cfb46c02e65c8e33091a4ff945e063fb6dd 100644 (file)
@@ -1,3 +1,9 @@
+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)
+
 Thu Feb 19 23:41:06 2004  Matthias Clasen  <maclas@gmx.de>
 
        Fixes for #82099:
@@ -6,8 +12,8 @@ Thu Feb 19 23:41:06 2004  Matthias Clasen  <maclas@gmx.de>
        and "Gtk/MenuImages" and map them to "gtk-button-images" and 
        "gtk-menu-images".
 
-       * gtk/gtkimagemenuitem.c: Add a boolean setting "gtk-menu-images" and use
-       it to set the visibility of the embedded image.
+       * gtk/gtkimagemenuitem.c: Add a boolean setting "gtk-menu-images" and 
+       use it to set the visibility of the embedded image.
 
        * gtk/gtkbutton.c: Add a boolean setting "gtk-button-images" and use
        it to set the visibility of an embedded image.
index 311daed66d9ffcc56871772a206abfbe9f155047..21fa0cfb46c02e65c8e33091a4ff945e063fb6dd 100644 (file)
@@ -1,3 +1,9 @@
+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)
+
 Thu Feb 19 23:41:06 2004  Matthias Clasen  <maclas@gmx.de>
 
        Fixes for #82099:
@@ -6,8 +12,8 @@ Thu Feb 19 23:41:06 2004  Matthias Clasen  <maclas@gmx.de>
        and "Gtk/MenuImages" and map them to "gtk-button-images" and 
        "gtk-menu-images".
 
-       * gtk/gtkimagemenuitem.c: Add a boolean setting "gtk-menu-images" and use
-       it to set the visibility of the embedded image.
+       * gtk/gtkimagemenuitem.c: Add a boolean setting "gtk-menu-images" and 
+       use it to set the visibility of the embedded image.
 
        * gtk/gtkbutton.c: Add a boolean setting "gtk-button-images" and use
        it to set the visibility of an embedded image.
index 0bdb73ed644b9b2e6f87e0b1e050c484f9533ae9..6197780dad80ab84f60eebbc0c64a9842a78e5aa 100644 (file)
@@ -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