diff options
author | Xan Lopez <xan@igalia.com> | 2012-01-17 07:36:14 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-01-17 07:36:14 +0800 |
commit | 94ddc090c0719baa827228d09ee92d952508aeb3 (patch) | |
tree | e8b56b7d8482d7801b059cb9d981b5869b9912e6 /src | |
parent | 01bddb73b6a99980148a61d621c0549739f28207 (diff) | |
download | gsoc2013-epiphany-94ddc090c0719baa827228d09ee92d952508aeb3.tar gsoc2013-epiphany-94ddc090c0719baa827228d09ee92d952508aeb3.tar.gz gsoc2013-epiphany-94ddc090c0719baa827228d09ee92d952508aeb3.tar.bz2 gsoc2013-epiphany-94ddc090c0719baa827228d09ee92d952508aeb3.tar.lz gsoc2013-epiphany-94ddc090c0719baa827228d09ee92d952508aeb3.tar.xz gsoc2013-epiphany-94ddc090c0719baa827228d09ee92d952508aeb3.tar.zst gsoc2013-epiphany-94ddc090c0719baa827228d09ee92d952508aeb3.zip |
ephy-page-menu-action: set the style class in the button, not the menu
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-page-menu-action.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/ephy-page-menu-action.c b/src/ephy-page-menu-action.c index 05efbdb6d..03e305ea6 100644 --- a/src/ephy-page-menu-action.c +++ b/src/ephy-page-menu-action.c @@ -61,13 +61,13 @@ menu_position_func (GtkMenu *menu, } static void -visible_cb (GtkWidget *menu, GParamSpec *pspec, gpointer user_data) +visible_cb (GtkWidget *menu, GParamSpec *pspec, GtkWidget *button) { if (gtk_widget_get_visible (menu)) - gtk_style_context_add_class (gtk_widget_get_style_context (menu), + gtk_style_context_add_class (gtk_widget_get_style_context (button), "active-menu"); else - gtk_style_context_remove_class (gtk_widget_get_style_context (menu), + gtk_style_context_remove_class (gtk_widget_get_style_context (button), "active-menu"); } @@ -80,25 +80,25 @@ button_press_cb (GtkWidget *button, GdkEventButton *event, EphyPageMenuAction *a guint event_button = 1; guint32 event_time = 0; + if (!button) { + GSList *l = gtk_action_get_proxies (GTK_ACTION (action)); + if (GTK_IS_BUTTON (l->data)) + button = GTK_WIDGET (l->data); + } + + g_return_if_fail (GTK_IS_BUTTON (button)); + if (!action->priv->menu) { window = ephy_window_action_get_window (EPHY_WINDOW_ACTION (action)); manager = GTK_UI_MANAGER (ephy_window_get_ui_manager (window)); menu = gtk_ui_manager_get_widget (manager, "/ui/PagePopup"); g_signal_connect (menu, "notify::visible", - G_CALLBACK (visible_cb), NULL); + G_CALLBACK (visible_cb), button); action->priv->menu = g_object_ref (menu); } - if (!button) { - GSList *l = gtk_action_get_proxies (GTK_ACTION (action)); - if (GTK_IS_BUTTON (l->data)) - button = GTK_WIDGET (l->data); - } - - g_return_if_fail (GTK_IS_BUTTON (button)); - if (event) { event_button = event->button; event_time = event->time; |