summaryrefslogtreecommitdiff
path: root/gtk/gtktogglebutton.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-06-24 13:03:47 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-06-24 13:03:47 -0400
commit1b3542419c0878277169e764a7d9ebb57ad55634 (patch)
tree569f9e058142f83f8f74feb1b74ad72708e15bed /gtk/gtktogglebutton.c
parent5cce44c0e1acaba05fcecd95fa6351deee2fd585 (diff)
downloadgtk+-1b3542419c0878277169e764a7d9ebb57ad55634.tar.gz
GtkToggleButton: Queue a redraw on enter/leave
Without this, we don't redraw consistently for prelight state changes.
Diffstat (limited to 'gtk/gtktogglebutton.c')
-rw-r--r--gtk/gtktogglebutton.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c
index 96856c26ff..ef5ece56df 100644
--- a/gtk/gtktogglebutton.c
+++ b/gtk/gtktogglebutton.c
@@ -136,6 +136,7 @@ static void gtk_toggle_button_get_property (GObject *object,
GValue *value,
GParamSpec *pspec);
static void gtk_toggle_button_update_state (GtkButton *button);
+static void gtk_toggle_button_enter_leave (GtkButton *button);
static void gtk_toggle_button_activatable_interface_init (GtkActivatableIface *iface);
@@ -174,8 +175,8 @@ gtk_toggle_button_class_init (GtkToggleButtonClass *class)
button_class->pressed = gtk_toggle_button_pressed;
button_class->released = gtk_toggle_button_released;
button_class->clicked = gtk_toggle_button_clicked;
- button_class->enter = gtk_toggle_button_update_state;
- button_class->leave = gtk_toggle_button_update_state;
+ button_class->enter = gtk_toggle_button_enter_leave;
+ button_class->leave = gtk_toggle_button_enter_leave;
class->toggled = NULL;
@@ -639,6 +640,13 @@ gtk_toggle_button_clicked (GtkButton *button)
}
static void
+gtk_toggle_button_enter_leave (GtkButton *button)
+{
+ gtk_toggle_button_update_state (button);
+ gtk_widget_queue_draw (GTK_WIDGET (button));
+}
+
+static void
gtk_toggle_button_update_state (GtkButton *button)
{
GtkToggleButton *toggle_button = GTK_TOGGLE_BUTTON (button);