aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-01-01 18:37:11 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-01-01 18:37:11 +0800
commita4f9aed333d06c864f4ed719fa41eda82eff4713 (patch)
tree7daf75b10d5a45b9f7b6fc7e6f74dfce87b5a573 /lib
parent90870f6628f09e7e46693c95c9237b602960f1ab (diff)
downloadgsoc2013-epiphany-a4f9aed333d06c864f4ed719fa41eda82eff4713.tar
gsoc2013-epiphany-a4f9aed333d06c864f4ed719fa41eda82eff4713.tar.gz
gsoc2013-epiphany-a4f9aed333d06c864f4ed719fa41eda82eff4713.tar.bz2
gsoc2013-epiphany-a4f9aed333d06c864f4ed719fa41eda82eff4713.tar.lz
gsoc2013-epiphany-a4f9aed333d06c864f4ed719fa41eda82eff4713.tar.xz
gsoc2013-epiphany-a4f9aed333d06c864f4ed719fa41eda82eff4713.tar.zst
gsoc2013-epiphany-a4f9aed333d06c864f4ed719fa41eda82eff4713.zip
*** empty log message ***
Diffstat (limited to 'lib')
-rw-r--r--lib/toolbar/ephy-tb-button.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/lib/toolbar/ephy-tb-button.c b/lib/toolbar/ephy-tb-button.c
index 4b251a094..4485102f0 100644
--- a/lib/toolbar/ephy-tb-button.c
+++ b/lib/toolbar/ephy-tb-button.c
@@ -374,6 +374,30 @@ ephy_tb_button_set_image (EphyTbButton *b, GtkWidget *image)
ephy_tb_button_build (b);
}
+static void
+button_state_changed_cb (GtkWidget *widget, GtkStateType previous_state, EphyTbButton *b)
+{
+ EphyTbButtonPrivate *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)
+ {
+ gtk_widget_set_state (button, state);
+ }
+}
+
void
ephy_tb_button_set_show_arrow (EphyTbButton *b, gboolean value)
{
@@ -402,10 +426,15 @@ ephy_tb_button_set_show_arrow (EphyTbButton *b, gboolean value)
g_signal_connect (p->arrow_widget, "key_press_event",
G_CALLBACK (ephy_tb_button_arrow_key_press_event_cb),
b);
-
g_signal_connect (p->arrow_widget, "button_press_event",
G_CALLBACK (ephy_tb_button_arrow_button_press_event_cb),
b);
+ g_signal_connect (p->arrow_widget, "state_changed",
+ G_CALLBACK (button_state_changed_cb),
+ b);
+ g_signal_connect (p->button, "state_changed",
+ G_CALLBACK (button_state_changed_cb),
+ b);
gtk_widget_show_all (p->arrow_widget);
gtk_box_pack_end_defaults (GTK_BOX (b), p->arrow_widget);
@@ -420,7 +449,7 @@ ephy_tb_button_set_enable_menu (EphyTbButton *b, gboolean value)
if (value && !p->menu)
{
p->menu = GTK_MENU (gtk_menu_new ());
- g_signal_connect (p->menu, "deactivate",
+ g_signal_connect (p->menu, "deactivate",
G_CALLBACK (ephy_tb_button_menu_deactivated_cb), b);
}
else if (!value && p->menu)