Re: [gtk-list] Check Box Patch



Warwick Mitchell wrote:

> Hi,
>
> I had a problem with the checkbox where users were winging that it was
> hard to see sometimes when the check box was pushed in or not. So i
> changed the color in the style to red so it was easier to see when
> depressed. This was quite simple, however, when the mouse was moved over
> the top the whole thing went the the prelight color, even the depressed
> button. I have enclosed a patch that sets the depressed button to the
> color stored in the selected state of bg when the mouse is over the
> widget. Not sure if it will want to be used or not. It is applied to
> 0.99.10.

Whoops....that patch was incomplete. Here's the whole one. Sorry :)

Warwick Mitchell

--- gtk+-0.99.10/gtk/gtkcheckbutton.c.orig	Mon Apr 13 19:03:04 1998
+++ gtk+-0.99.10/gtk/gtkcheckbutton.c	Mon Apr 13 19:31:40 1998
@@ -367,11 +367,15 @@
       else
 	shadow_type = GTK_SHADOW_OUT;
 
+      state_type = GTK_WIDGET_STATE (widget);
+      if ((state_type == GTK_STATE_PRELIGHT) && (toggle_button->active))
+       state_type = GTK_STATE_SELECTED;
+
       gdk_draw_rectangle (widget->window,
-			  widget->style->bg_gc[GTK_WIDGET_STATE (widget)],
+			  widget->style->bg_gc[state_type],
 			  TRUE, x + 1, y + 1, width, height);
       gtk_draw_shadow (widget->style, widget->window,
-		       GTK_WIDGET_STATE (widget), shadow_type,
+		       state_type, shadow_type,
 		       x + 1, y + 1, width, height);
     }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]