aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-statusbar.c
diff options
context:
space:
mode:
authorAdam Hooper <adamh@src.gnome.org>2004-07-01 09:47:17 +0800
committerAdam Hooper <adamh@src.gnome.org>2004-07-01 09:47:17 +0800
commitbbd9d6551d3f84f4cc7afa5ef4c21dfadceb668d (patch)
treed368c9eec18379a062af184d89b064517273c558 /src/ephy-statusbar.c
parent61533f01f0f6df3b9dafc18d1567507830db0752 (diff)
downloadgsoc2013-epiphany-bbd9d6551d3f84f4cc7afa5ef4c21dfadceb668d.tar
gsoc2013-epiphany-bbd9d6551d3f84f4cc7afa5ef4c21dfadceb668d.tar.gz
gsoc2013-epiphany-bbd9d6551d3f84f4cc7afa5ef4c21dfadceb668d.tar.bz2
gsoc2013-epiphany-bbd9d6551d3f84f4cc7afa5ef4c21dfadceb668d.tar.lz
gsoc2013-epiphany-bbd9d6551d3f84f4cc7afa5ef4c21dfadceb668d.tar.xz
gsoc2013-epiphany-bbd9d6551d3f84f4cc7afa5ef4c21dfadceb668d.tar.zst
gsoc2013-epiphany-bbd9d6551d3f84f4cc7afa5ef4c21dfadceb668d.zip
Popup blocking support. View -> Popup Windows.
Diffstat (limited to 'src/ephy-statusbar.c')
-rwxr-xr-xsrc/ephy-statusbar.c62
1 files changed, 61 insertions, 1 deletions
diff --git a/src/ephy-statusbar.c b/src/ephy-statusbar.c
index 1e8d22259..8e2e8c475 100755
--- a/src/ephy-statusbar.c
+++ b/src/ephy-statusbar.c
@@ -50,6 +50,8 @@ struct EphyStatusbarPrivate
GtkWidget *security_icon;
GtkWidget *progressbar;
GtkWidget *security_evbox;
+ GtkWidget *popups_manager_icon;
+ GtkWidget *popups_manager_evbox;
};
GType
@@ -118,6 +120,36 @@ create_statusbar_security_icon (EphyStatusbar *s)
}
static void
+create_statusbar_popups_manager_icon (EphyStatusbar *s)
+{
+ s->popups_manager_frame = gtk_frame_new (NULL);
+ gtk_frame_set_shadow_type (GTK_FRAME (s->popups_manager_frame),
+ GTK_SHADOW_IN);
+
+ s->priv->popups_manager_icon = gtk_image_new_from_stock
+ (EPHY_STOCK_POPUPS, GTK_ICON_SIZE_MENU);
+
+ s->priv->popups_manager_evbox = gtk_event_box_new ();
+
+ gtk_event_box_set_visible_window
+ (GTK_EVENT_BOX (s->priv->popups_manager_evbox), FALSE);
+
+ gtk_container_add (GTK_CONTAINER (s->popups_manager_frame),
+ GTK_WIDGET (s->priv->popups_manager_evbox));
+ gtk_container_add (GTK_CONTAINER (s->priv->popups_manager_evbox),
+ GTK_WIDGET (s->priv->popups_manager_icon));
+
+ gtk_widget_show (s->priv->popups_manager_evbox);
+ gtk_widget_show (s->priv->popups_manager_icon);
+
+ /* note lack of gtk_widget_show (s->popups_manager_frame); */
+
+ gtk_box_pack_start (GTK_BOX (s->priv->icon_container),
+ GTK_WIDGET (s->popups_manager_frame),
+ FALSE, TRUE, 0);
+}
+
+static void
create_statusbar_progress (EphyStatusbar *s)
{
s->priv->progressbar = gtk_progress_bar_new ();
@@ -170,6 +202,7 @@ ephy_statusbar_init (EphyStatusbar *t)
create_statusbar_progress (t);
create_statusbar_security_icon (t);
+ create_statusbar_popups_manager_icon (t);
/* FIXME: is this the right way ? */
sync_shadow_type (t, NULL, NULL);
@@ -202,7 +235,7 @@ ephy_statusbar_new (void)
/**
* ephy_statusbar_set_security_state:
- * @statusbar: a #EphyStatusbar
+ * @statusbar: an #EphyStatusbar
* @secure: whether to set the icon to show secure or insecure
* @tooltip: a string detailing the security state
*
@@ -225,6 +258,33 @@ ephy_statusbar_set_security_state (EphyStatusbar *statusbar,
}
/**
+ * 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)
+{
+ if (hidden)
+ {
+ gtk_widget_hide (statusbar->popups_manager_frame);
+ }
+ else
+ {
+ gtk_tooltips_set_tip (statusbar->tooltips,
+ statusbar->priv->popups_manager_evbox,
+ tooltip, NULL);
+
+ gtk_widget_show (statusbar->popups_manager_frame);
+ }
+}
+
+/**
* ephy_statusbar_set_progress:
* @statusbar: a #EphyStatusbar
* @progress: the progress as an integer between 0 and 100 per cent.