From 94c177286f98d5ae22669eed8ed1e48fbf1e5ebe Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Fri, 18 Apr 2003 17:48:01 +0000 Subject: Fix the bug with back/fwd buttons auto prelighting. 2003-04-18 Marco Pesenti Gritti * lib/widgets/ephy-arrow-toolbutton.c: (button_state_changed_cb): Fix the bug with back/fwd buttons auto prelighting. --- lib/widgets/ephy-arrow-toolbutton.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'lib/widgets') diff --git a/lib/widgets/ephy-arrow-toolbutton.c b/lib/widgets/ephy-arrow-toolbutton.c index abc5ed4f2..e769abd34 100644 --- a/lib/widgets/ephy-arrow-toolbutton.c +++ b/lib/widgets/ephy-arrow-toolbutton.c @@ -103,22 +103,30 @@ button_state_changed_cb (GtkWidget *widget, EphyArrowToolButtonPrivate *p = b->priv; GtkWidget *button; GtkStateType state = GTK_WIDGET_STATE (widget); - GtkStateType other; - - if (state == GTK_STATE_ACTIVE || - state == GTK_STATE_SELECTED || - state == GTK_STATE_INSENSITIVE) - { - return; - } button = (widget == p->arrow_widget) ? p->button : p->arrow_widget; - other = GTK_WIDGET_STATE (button); - if (state != other) + g_signal_handlers_block_by_func + (G_OBJECT (button), + G_CALLBACK (button_state_changed_cb), + b); + if (state == GTK_STATE_PRELIGHT && + previous_state != GTK_STATE_ACTIVE) { gtk_widget_set_state (button, state); } + else if (state == GTK_STATE_NORMAL) + { + gtk_widget_set_state (button, state); + } + else if (state == GTK_STATE_ACTIVE) + { + gtk_widget_set_state (button, GTK_STATE_NORMAL); + } + g_signal_handlers_unblock_by_func + (G_OBJECT (button), + G_CALLBACK (button_state_changed_cb), + b); } static void -- cgit v1.2.3