[epiphany/overlay-progressbar: 1/2] Use a GtkOverlay for the statusbar instead of shipping GeditOverlay
- From: Claudio Saavedra <csaavedra src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/overlay-progressbar: 1/2] Use a GtkOverlay for the statusbar instead of shipping GeditOverlay
- Date: Mon, 5 Dec 2011 20:24:28 +0000 (UTC)
commit 7f83baef9da80a4a4fd630418618d5619d0cadeb
Author: Claudio Saavedra <csaavedra igalia com>
Date: Sun Dec 4 19:27:50 2011 +0100
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
embed/ephy-embed.c | 38 ++-
lib/widgets/Makefile.am | 8 +-
lib/widgets/gedit-overlay-child.c | 362 -------------------------
lib/widgets/gedit-overlay-child.h | 89 ------
lib/widgets/gedit-overlay.c | 542 -------------------------------------
lib/widgets/gedit-overlay.h | 70 -----
6 files changed, 29 insertions(+), 1080 deletions(-)
---
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index e9b442a..1a801fb 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -41,8 +41,6 @@
#include "ephy-stock-icons.h"
#include "ephy-string.h"
#include "ephy-web-view.h"
-#include "gedit-overlay.h"
-#include "ephy-overlay-escaping-child.h"
#include <errno.h>
#include <glib/gi18n.h>
@@ -510,6 +508,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)
{
@@ -521,26 +535,30 @@ 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);
+ gtk_widget_add_events (eventbox, GDK_ENTER_NOTIFY_MASK);
+ g_signal_connect (eventbox, "enter-notify-event",
+ G_CALLBACK (frame_enter_notify_cb), object);
paned = GTK_WIDGET (embed->priv->paned);
diff --git a/lib/widgets/Makefile.am b/lib/widgets/Makefile.am
index 66c9f90..f9a114e 100644
--- a/lib/widgets/Makefile.am
+++ b/lib/widgets/Makefile.am
@@ -18,13 +18,7 @@ libephywidgets_la_SOURCES = \
ephy-zoom-action.h \
ephy-zoom-action.c \
ephy-zoom-control.c \
- ephy-zoom-control.h \
- gedit-overlay.c \
- gedit-overlay.h \
- gedit-overlay-child.c \
- gedit-overlay-child.h \
- ephy-overlay-escaping-child.c \
- ephy-overlay-escaping-child.h
+ ephy-zoom-control.h
libephywidgets_la_CPPFLAGS = \
-I$(top_builddir)/lib \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]