aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-embed.c
diff options
context:
space:
mode:
authorXan Lopez <xan@gnome.org>2011-02-11 05:27:40 +0800
committerXan Lopez <xan@gnome.org>2011-02-11 05:35:09 +0800
commit87466892eb08ec1f5efd6ea33589355b9bab05d0 (patch)
treec8627fb43f7706e73d9519b95770608b7186465d /embed/ephy-embed.c
parentcfff1c9b9f901c64645347a712dae702501f6d4e (diff)
downloadgsoc2013-epiphany-87466892eb08ec1f5efd6ea33589355b9bab05d0.tar
gsoc2013-epiphany-87466892eb08ec1f5efd6ea33589355b9bab05d0.tar.gz
gsoc2013-epiphany-87466892eb08ec1f5efd6ea33589355b9bab05d0.tar.bz2
gsoc2013-epiphany-87466892eb08ec1f5efd6ea33589355b9bab05d0.tar.lz
gsoc2013-epiphany-87466892eb08ec1f5efd6ea33589355b9bab05d0.tar.xz
gsoc2013-epiphany-87466892eb08ec1f5efd6ea33589355b9bab05d0.tar.zst
gsoc2013-epiphany-87466892eb08ec1f5efd6ea33589355b9bab05d0.zip
Port floating statusbar to gedit's overlay widget
Works correctly in framed pages, and fixes a few bugs along the way (not to mention it should be more efficient since it does not redraw needlessly). The gedit code has been modified to get rid of the animation stuff we don't really need atm; we have coordinated with the gedit developers and hopefully both versions will be in sync again really soon.
Diffstat (limited to 'embed/ephy-embed.c')
-rw-r--r--embed/ephy-embed.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index 07e6ed25a..79515cb86 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -43,6 +43,7 @@
#include "ephy-stock-icons.h"
#include "ephy-string.h"
#include "ephy-web-view.h"
+#include "gedit-overlay.h"
#include <errno.h>
#include <glib/gi18n.h>
@@ -72,6 +73,7 @@ struct _EphyEmbedPrivate
gboolean inspector_attached;
guint is_setting_zoom : 1;
GSList *destroy_on_transition_list;
+ GtkWidget *statusbar_label;
};
G_DEFINE_TYPE (EphyEmbed, ephy_embed, GTK_TYPE_VBOX)
@@ -840,25 +842,52 @@ download_requested_cb (WebKitWebView *web_view,
return TRUE;
}
+/* FIXME: it probably makes sense to move this stuff completely into
+ * EphyEmbed now, since it's not an integral part of EphyWebView
+ * anymore. */
+void
+_ephy_embed_set_statusbar_label (EphyEmbed *embed, const char *label)
+{
+ EphyEmbedPrivate *priv = embed->priv;
+ gtk_label_set_label (GTK_LABEL (priv->statusbar_label), label);
+
+ if (label == NULL || label[0] == '\0')
+ gtk_widget_hide (priv->statusbar_label);
+ else
+ gtk_widget_show (priv->statusbar_label);
+}
+
static void
ephy_embed_constructed (GObject *object)
{
EphyEmbed *embed = (EphyEmbed*)object;
+ EphyEmbedPrivate *priv = embed->priv;
GtkWidget *scrolled_window;
GtkWidget *paned;
WebKitWebView *web_view;
WebKitWebInspector *inspector;
+ GtkWidget *overlay;
+ GtkWidget *frame;
/* Skeleton */
web_view = WEBKIT_WEB_VIEW (ephy_web_view_new ());
scrolled_window = GTK_WIDGET (embed->priv->scrolled_window);
+ overlay = gedit_overlay_new (scrolled_window);
+
+ /* statusbar is hidden by default */
+ priv->statusbar_label = gtk_label_new (NULL);
+ frame = gtk_frame_new (NULL);
+ gtk_widget_show (frame);
+ gtk_container_add (GTK_CONTAINER (frame), priv->statusbar_label);
+ gedit_overlay_add (GEDIT_OVERLAY (overlay), frame, GTK_ORIENTATION_HORIZONTAL, GDK_GRAVITY_SOUTH_WEST, 0, TRUE);
+
paned = GTK_WIDGET (embed->priv->paned);
embed->priv->web_view = web_view;
gtk_container_add (GTK_CONTAINER (embed->priv->scrolled_window),
GTK_WIDGET (web_view));
- gtk_paned_pack1 (GTK_PANED (paned), GTK_WIDGET (scrolled_window),
+ gtk_paned_pack1 (GTK_PANED (paned), GTK_WIDGET (overlay),
TRUE, FALSE);
gtk_box_pack_start (GTK_BOX (embed),