aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorClaudio Saavedra <csaavedra@igalia.com>2011-12-05 02:27:50 +0800
committerClaudio Saavedra <csaavedra@igalia.com>2011-12-14 19:51:19 +0800
commit762a30c569efd36510f7b418a0c11aee84320a6c (patch)
treed27d3049de58652c41bb00b4fbaf7edac0ee0b0b /embed
parentb370ee25bcc3c464b57e4c090ce8adc6677f8f96 (diff)
downloadgsoc2013-epiphany-762a30c569efd36510f7b418a0c11aee84320a6c.tar
gsoc2013-epiphany-762a30c569efd36510f7b418a0c11aee84320a6c.tar.gz
gsoc2013-epiphany-762a30c569efd36510f7b418a0c11aee84320a6c.tar.bz2
gsoc2013-epiphany-762a30c569efd36510f7b418a0c11aee84320a6c.tar.lz
gsoc2013-epiphany-762a30c569efd36510f7b418a0c11aee84320a6c.tar.xz
gsoc2013-epiphany-762a30c569efd36510f7b418a0c11aee84320a6c.tar.zst
gsoc2013-epiphany-762a30c569efd36510f7b418a0c11aee84320a6c.zip
Use a GtkOverlay for the statusbar instead of shipping GeditOverlay
Instead of escaping the cursor, we align the overlay at the opposite side of the window. This is consistent with nautilus. https://bugzilla.gnome.org/show_bug.cgi?id=653996
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-embed.c37
1 files changed, 27 insertions, 10 deletions
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index fede503b3..0f2211aed 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -36,13 +36,11 @@
#include "ephy-embed-utils.h"
#include "ephy-file-helpers.h"
#include "ephy-history.h"
-#include "ephy-overlay-escaping-child.h"
#include "ephy-prefs.h"
#include "ephy-settings.h"
#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>
@@ -508,6 +506,22 @@ window_resize_requested (WebKitWebWindowFeatures *features, GParamSpec *pspec, E
gtk_window_resize (GTK_WINDOW (window), width, height);
}
+static gboolean
+frame_enter_notify_cb (GtkWidget *widget,
+ GdkEventCrossing *event,
+ gpointer user_data)
+{
+ if (gtk_widget_get_halign (widget) == GTK_ALIGN_START) {
+ gtk_widget_set_halign (widget, GTK_ALIGN_END);
+ } else {
+ gtk_widget_set_halign (widget, GTK_ALIGN_START);
+ }
+
+ gtk_widget_queue_resize (widget);
+
+ return FALSE;
+}
+
static void
ephy_embed_constructed (GObject *object)
{
@@ -519,26 +533,29 @@ ephy_embed_constructed (GObject *object)
WebKitWebWindowFeatures *window_features;
WebKitWebInspector *inspector;
GtkWidget *overlay;
- EphyOverlayEscapingChild *escaping_child;
GtkWidget *frame;
+ GtkWidget *eventbox;
/* Skeleton */
web_view = WEBKIT_WEB_VIEW (ephy_web_view_new ());
scrolled_window = GTK_WIDGET (embed->priv->scrolled_window);
- overlay = gedit_overlay_new (scrolled_window, GTK_WIDGET (web_view));
+ overlay = gtk_overlay_new ();
+ gtk_container_add (GTK_CONTAINER (overlay), GTK_WIDGET (scrolled_window));
/* statusbar is hidden by default */
priv->statusbar_label = gtk_label_new (NULL);
+ eventbox = gtk_event_box_new ();
frame = gtk_frame_new (NULL);
gtk_widget_set_name (frame, "ephy-status-frame");
+ gtk_widget_set_halign (eventbox, GTK_ALIGN_START);
+ gtk_widget_set_valign (eventbox, GTK_ALIGN_END);
+ gtk_widget_show (eventbox);
- gtk_widget_show (frame);
-
+ gtk_container_add (GTK_CONTAINER (eventbox), frame);
gtk_container_add (GTK_CONTAINER (frame), priv->statusbar_label);
- escaping_child = ephy_overlay_escaping_child_new (frame);
- gedit_overlay_add (GEDIT_OVERLAY (overlay),
- GTK_WIDGET (escaping_child),
- GEDIT_OVERLAY_CHILD_POSITION_SOUTH_WEST, 0);
+ gtk_overlay_add_overlay (GTK_OVERLAY (overlay), eventbox);
+ g_signal_connect (eventbox, "enter-notify-event",
+ G_CALLBACK (frame_enter_notify_cb), object);
paned = GTK_WIDGET (embed->priv->paned);