summaryrefslogtreecommitdiff
path: root/gtk/gtktogglebutton.c
diff options
context:
space:
mode:
authorTim Janik <timj@gtk.org>1998-03-26 21:57:45 +0000
committerTim Janik <timj@src.gnome.org>1998-03-26 21:57:45 +0000
commitc2906f2beaf51a3528550e3146fc046ad9b7c65f (patch)
treea36a48cd35aed86584fbab7c39eaf87fa43928c0 /gtk/gtktogglebutton.c
parenta74e338517b9b7cab0b422b4a0361cb0ef50593d (diff)
downloadgtk+-c2906f2beaf51a3528550e3146fc046ad9b7c65f.tar.gz
always display the correct active state.
Thu Mar 26 21:37:57 1998 Tim Janik <timj@gtk.org> * gtk/gtkradiobutton.c (gtk_radio_button_draw_indicator): always display the correct active state. * gtk/gtkcheckbutton.c (gtk_real_check_button_draw_indicator): always display the correct active state. * gtk/gtkwidget.c (gtk_widget_set_arg): CAN_FOCUS and CAN_DEFAULT flag changes need to queue a resize. * gtk/gtkbutton.c (gtk_button_paint): take border_width into consideration for restrict area. * gtk/gtktogglebutton.c (gtk_toggle_button_class_init): enable the draw_default member of GtkButton, otherwise the diplay is messed up for CAN_DEFAULT toggles. (gtk_toggle_button_draw_focus): always display whether the toggle button is active or not. * gtk/gtkwidget.c (gtk_widget_set_state): (gtk_widget_set_sensitive): (gtk_widget_set_parent): (gtk_widget_propagate_state): take into consideration, whether we really want to change childrens states, or just restauration of old states.
Diffstat (limited to 'gtk/gtktogglebutton.c')
-rw-r--r--gtk/gtktogglebutton.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c
index ef57d87260..8dbcba2100 100644
--- a/gtk/gtktogglebutton.c
+++ b/gtk/gtktogglebutton.c
@@ -92,7 +92,6 @@ gtk_toggle_button_class_init (GtkToggleButtonClass *class)
gtk_object_class_add_signals (object_class, toggle_button_signals, LAST_SIGNAL);
widget_class->draw_focus = gtk_toggle_button_draw_focus;
- widget_class->draw_default = NULL;
button_class->pressed = gtk_toggle_button_pressed;
button_class->released = gtk_toggle_button_released;
@@ -181,15 +180,15 @@ gtk_toggle_button_draw_focus (GtkWidget *widget)
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_TOGGLE_BUTTON (widget));
- if (GTK_WIDGET_DRAWABLE (widget))
+ if (GTK_WIDGET_DRAWABLE (widget))
{
button = GTK_BUTTON (widget);
toggle_button = GTK_TOGGLE_BUTTON (widget);
x = 0;
y = 0;
- width = widget->allocation.width - GTK_CONTAINER (widget)->border_width * 2;
- height = widget->allocation.height - GTK_CONTAINER (widget)->border_width * 2;
+ width = widget->allocation.width - GTK_CONTAINER (widget)->border_width * 2;
+ height = widget->allocation.height - GTK_CONTAINER (widget)->border_width * 2;
if (GTK_WIDGET_CAN_DEFAULT (widget))
{
@@ -210,7 +209,7 @@ gtk_toggle_button_draw_focus (GtkWidget *widget)
}
else
{
- if (GTK_WIDGET_STATE (widget) == GTK_STATE_ACTIVE)
+ if (GTK_WIDGET_STATE (toggle_button) == GTK_STATE_ACTIVE)
gdk_draw_rectangle (widget->window,
widget->style->bg_gc[GTK_WIDGET_STATE (widget)], FALSE,
x + 1, y + 1, width - 4, height - 4);
@@ -220,9 +219,7 @@ gtk_toggle_button_draw_focus (GtkWidget *widget)
x + 2, y + 2, width - 5, height - 5);
}
- if (GTK_WIDGET_STATE (widget) == GTK_STATE_ACTIVE)
- shadow_type = GTK_SHADOW_IN;
- else if ((GTK_WIDGET_STATE (widget) == GTK_STATE_PRELIGHT) && toggle_button->active)
+ if (toggle_button->active)
shadow_type = GTK_SHADOW_IN;
else
shadow_type = GTK_SHADOW_OUT;