summaryrefslogtreecommitdiff
path: root/gtk/gtktogglebutton.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2001-04-02 15:51:28 +0000
committerOwen Taylor <otaylor@src.gnome.org>2001-04-02 15:51:28 +0000
commitc944151a3cecd2ab199d1645e22d74fe9a66df0a (patch)
treee5719998626f9ff28d2fce5c88ff2de3c5d7bb43 /gtk/gtktogglebutton.c
parent5d1ee0929e0c4fb6cdbfa7a4bf28e2071da9a220 (diff)
downloadgtk+-c944151a3cecd2ab199d1645e22d74fe9a66df0a.tar.gz
Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE
Mon Apr 2 10:47:57 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c (gtk_widget_class_init): Fix G_VALUE_NO_COPY_CONTENTS instead of G_SIGNAL_TYPE_STATIC_SCOPE stupidity. Mon Apr 2 00:51:11 2001 Owen Taylor <otaylor@redhat.com> [ First pass at adding style properties. Still needs some definite fine-tuning. ] * gtk/gtkbutton.c: Add ::default_spacing style property. * gtk/gtkcheckbutton.[ch] gtkradiobutton.c: Add ::indicator_size, ::indicator_spacing style properties. * gtk/gtkoptionmenu.c: Add ::indicator_size, ::indicator_spacing style properties. * gtk/gtk{,h,v}paned.[ch]: Make handle_size a style property rather than a normal property. * gtk/gtkwidget.c: Add an ::interior_focus style property to draw focus inside buttons, in the Windows/Java Metal/etc. style. * gtk/gtkbutton.c gtk/gtkcheckbutton.c gtk/gtktogglenbutton.c: Honor ::interior_focus. * gtk/gtkentry.c: Don't draw focus at all when ::interior_focus is TRUE. * gtk/gtkrange.[ch] gtk/gtk{h,v}scrollbar.c gtk/gtk{h,v}scale.c: Add ::slider_width, ::trough_border, ::stepper_size, ::stepper_spacing style properties. * gtk/gtkscale.[ch] Add ::slider-length style property.
Diffstat (limited to 'gtk/gtktogglebutton.c')
-rw-r--r--gtk/gtktogglebutton.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c
index 773f4fe5f8..b4af1af243 100644
--- a/gtk/gtktogglebutton.c
+++ b/gtk/gtktogglebutton.c
@@ -360,6 +360,7 @@ gtk_toggle_button_paint (GtkWidget *widget,
GtkShadowType shadow_type;
GtkStateType state_type;
gint width, height;
+ gboolean interior_focus;
gint x, y;
button = GTK_BUTTON (widget);
@@ -367,6 +368,8 @@ gtk_toggle_button_paint (GtkWidget *widget,
if (GTK_WIDGET_DRAWABLE (widget))
{
+ gtk_widget_style_get (widget, "interior_focus", &interior_focus, NULL);
+
x = 0;
y = 0;
width = widget->allocation.width - GTK_CONTAINER (widget)->border_width * 2;
@@ -394,7 +397,7 @@ gtk_toggle_button_paint (GtkWidget *widget,
y += DEFAULT_TOP_POS;
}
- if (GTK_WIDGET_HAS_FOCUS (widget))
+ if (GTK_WIDGET_HAS_FOCUS (widget) && !interior_focus)
{
x += 1;
y += 1;
@@ -426,10 +429,20 @@ gtk_toggle_button_paint (GtkWidget *widget,
if (GTK_WIDGET_HAS_FOCUS (widget))
{
- x -= 1;
- y -= 1;
- width += 2;
- height += 2;
+ if (interior_focus)
+ {
+ x += widget->style->xthickness + 1;
+ y += widget->style->xthickness + 1;
+ width -= 2 * (widget->style->xthickness + 1);
+ height -= 2 * (widget->style->ythickness + 1);
+ }
+ else
+ {
+ x -= 1;
+ y -= 1;
+ width += 2;
+ height += 2;
+ }
gtk_paint_focus (widget->style, widget->window,
area, widget, "togglebutton",