diff options
author | Xan Lopez <xan@gnome.org> | 2010-05-13 19:17:09 +0800 |
---|---|---|
committer | Xan Lopez <xan@gnome.org> | 2010-05-13 19:17:09 +0800 |
commit | 36d9f9be4a55a44f6797716c4850341a348b75ad (patch) | |
tree | 34d4d22af226895bcb89a5e17be22a063e64830b /src | |
parent | a3f08a52b5b93c67665ad9ca4341e30940538cf1 (diff) | |
download | gsoc2013-epiphany-36d9f9be4a55a44f6797716c4850341a348b75ad.tar.gz gsoc2013-epiphany-36d9f9be4a55a44f6797716c4850341a348b75ad.tar.zst gsoc2013-epiphany-36d9f9be4a55a44f6797716c4850341a348b75ad.zip |
Remove popup state from the statusbar
The whole feature is kind of broken anyway. When we fix we'll figure
out how to show it in the UI.
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-statusbar.c | 91 | ||||
-rw-r--r-- | src/ephy-statusbar.h | 4 | ||||
-rw-r--r-- | src/ephy-window.c | 22 |
3 files changed, 1 insertions, 116 deletions
diff --git a/src/ephy-statusbar.c b/src/ephy-statusbar.c index bf37eb266..1fbcb555e 100644 --- a/src/ephy-statusbar.c +++ b/src/ephy-statusbar.c @@ -44,19 +44,8 @@ struct _EphyStatusbarPrivate { GtkWidget *hbox; GtkWidget *icon_container; - - GtkWidget *popups_manager_icon; - GtkWidget *popups_manager_evbox; }; -enum -{ - LOCK_CLICKED, - LAST_SIGNAL -}; - -static guint signals[LAST_SIGNAL]; - G_DEFINE_TYPE (EphyStatusbar, ephy_statusbar, GTK_TYPE_STATUSBAR) static void @@ -67,51 +56,6 @@ ephy_statusbar_class_init (EphyStatusbarClass *klass) g_type_class_add_private (object_class, sizeof (EphyStatusbarPrivate)); } -static gboolean -padlock_button_press_cb (GtkWidget *ebox, - GdkEventButton *event, - EphyStatusbar *statusbar) -{ - if (event->type == GDK_BUTTON_PRESS && - event->button == 1 /* left */ && - (event->state & gtk_accelerator_get_default_mod_mask ()) == 0) - { - g_signal_emit (statusbar, signals[LOCK_CLICKED], 0); - - return TRUE; - } - - return FALSE; -} - -static void -create_icon_frame (EphyStatusbar *statusbar, - const char *stock_id, - GCallback button_press_cb, - GtkWidget **_evbox, - GtkWidget **_icon) -{ - GtkWidget *evbox, *icon; - - evbox = gtk_event_box_new (); - gtk_event_box_set_visible_window (GTK_EVENT_BOX (evbox), FALSE); - if (button_press_cb) - { - gtk_widget_add_events (evbox, GDK_BUTTON_PRESS_MASK); - g_signal_connect (evbox, "button-press-event", - G_CALLBACK (padlock_button_press_cb), statusbar); - } - - icon = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_MENU); - gtk_container_add (GTK_CONTAINER (evbox), icon); - gtk_widget_show (icon); - - ephy_statusbar_add_widget (statusbar, evbox); - - *_evbox = evbox; - *_icon = icon; -} - static void ephy_statusbar_init (EphyStatusbar *t) { @@ -143,14 +87,6 @@ ephy_statusbar_init (EphyStatusbar *t) gtk_container_add (GTK_CONTAINER (gstatusbar->frame), priv->hbox); gtk_widget_show (priv->hbox); #endif - - /* Create popup-blocked icon */ - create_icon_frame (t, - EPHY_STOCK_POPUPS, - NULL, - &priv->popups_manager_evbox, - &priv->popups_manager_icon); - /* don't show priv->popups_manager_evbox yet */ } /** @@ -166,33 +102,6 @@ ephy_statusbar_new (void) return GTK_WIDGET (g_object_new (EPHY_TYPE_STATUSBAR, NULL)); } -/** - * ephy_statusbar_set_popups_state: - * @statusbar: an #EphyStatusbar - * @hidden: %TRUE if popups have been hidden - * @tooltip: a string to display as tooltip, or %NULL - * - * Sets the statusbar's popup-blocker icon's tooltip and visibility. - **/ -void -ephy_statusbar_set_popups_state (EphyStatusbar *statusbar, - gboolean hidden, - const char *tooltip) -{ - EphyStatusbarPrivate *priv = statusbar->priv; - - if (hidden) - { - gtk_widget_hide (priv->popups_manager_evbox); - } - else - { - gtk_widget_set_tooltip_text (priv->popups_manager_icon, tooltip); - - gtk_widget_show (priv->popups_manager_evbox); - } -} - static void sync_visibility (GtkWidget *widget, GParamSpec *pspec, diff --git a/src/ephy-statusbar.h b/src/ephy-statusbar.h index 32993605d..1cef654e9 100644 --- a/src/ephy-statusbar.h +++ b/src/ephy-statusbar.h @@ -58,10 +58,6 @@ GType ephy_statusbar_get_type (void); GtkWidget *ephy_statusbar_new (void); -void ephy_statusbar_set_popups_state (EphyStatusbar *statusbar, - gboolean hidden, - const char *tooltip); - void ephy_statusbar_add_widget (EphyStatusbar *statusbar, GtkWidget *widget); diff --git a/src/ephy-window.c b/src/ephy-window.c index 31502ee4a..4b394ae11 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -1762,27 +1762,7 @@ sync_tab_popup_windows (EphyWebView *view, GParamSpec *pspec, EphyWindow *window) { - guint num_popups = 0; - char *tooltip = NULL; - - g_object_get (view, - "hidden-popup-count", &num_popups, - NULL); - - if (num_popups > 0) - { - tooltip = g_strdup_printf (ngettext ("%d hidden popup window", - "%d hidden popup windows", - num_popups), - num_popups); - } - - ephy_statusbar_set_popups_state - (EPHY_STATUSBAR (window->priv->statusbar), - tooltip == NULL, - tooltip); - - g_free (tooltip); + /* FIXME: show popup count somehow */ } static void |