aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorGustavo Noronha Silva <gns@gnome.org>2009-12-16 20:35:55 +0800
committerGustavo Noronha Silva <gns@gnome.org>2009-12-17 20:21:25 +0800
commitde05c84965bc829f14fb9165bd05d5612967a36d (patch)
tree943d0bda5b6e028ec4fb578eb65cbc6920a3b793 /embed
parent092c7136695555fbd44c51e37c36202c7a2cb832 (diff)
downloadgsoc2013-epiphany-de05c84965bc829f14fb9165bd05d5612967a36d.tar
gsoc2013-epiphany-de05c84965bc829f14fb9165bd05d5612967a36d.tar.gz
gsoc2013-epiphany-de05c84965bc829f14fb9165bd05d5612967a36d.tar.bz2
gsoc2013-epiphany-de05c84965bc829f14fb9165bd05d5612967a36d.tar.lz
gsoc2013-epiphany-de05c84965bc829f14fb9165bd05d5612967a36d.tar.xz
gsoc2013-epiphany-de05c84965bc829f14fb9165bd05d5612967a36d.tar.zst
gsoc2013-epiphany-de05c84965bc829f14fb9165bd05d5612967a36d.zip
Make EphyEmbed inherit from GtkVBox instead of GtkScrolledWindow
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-embed-utils.h5
-rw-r--r--embed/ephy-embed.c19
-rw-r--r--embed/ephy-embed.h4
-rw-r--r--embed/ephy-web-view.c2
4 files changed, 19 insertions, 11 deletions
diff --git a/embed/ephy-embed-utils.h b/embed/ephy-embed-utils.h
index 5d82171e9..3b6d1b609 100644
--- a/embed/ephy-embed-utils.h
+++ b/embed/ephy-embed-utils.h
@@ -35,9 +35,8 @@
G_BEGIN_DECLS
-#define EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED(embed) (WEBKIT_WEB_VIEW (gtk_bin_get_child (GTK_BIN (embed))))
-#define EPHY_GET_EPHY_WEB_VIEW_FROM_EMBED(embed) (EPHY_WEB_VIEW (gtk_bin_get_child (GTK_BIN (embed))))
-#define EPHY_GET_EMBED_FROM_EPHY_WEB_VIEW(view) (EPHY_EMBED (gtk_widget_get_parent (GTK_WIDGET (view))))
+#define EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED(embed) (WEBKIT_WEB_VIEW (ephy_embed_get_web_view (embed)))
+#define EPHY_GET_EMBED_FROM_EPHY_WEB_VIEW(view) (EPHY_EMBED (gtk_widget_get_parent (gtk_widget_get_parent (GTK_WIDGET (view)))))
#define EPHY_WEBKIT_BACK_FORWARD_LIMIT 100
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index 53ae59ce4..48df876a3 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -57,6 +57,7 @@ static void ephy_embed_constructed (GObject *object);
struct EphyEmbedPrivate
{
+ GtkScrolledWindow *scrolled_window;
WebKitWebView *web_view;
EphyHistory *history;
GtkWidget *inspector_window;
@@ -64,7 +65,7 @@ struct EphyEmbedPrivate
guint is_setting_zoom : 1;
};
-G_DEFINE_TYPE (EphyEmbed, ephy_embed, GTK_TYPE_SCROLLED_WINDOW)
+G_DEFINE_TYPE (EphyEmbed, ephy_embed, GTK_TYPE_VBOX)
static void
uri_changed_cb (WebKitWebView *web_view,
@@ -296,7 +297,7 @@ ephy_embed_grab_focus (GtkWidget *widget)
{
GtkWidget *child;
- child = gtk_bin_get_child (GTK_BIN (widget));
+ child = GTK_WIDGET (ephy_embed_get_web_view (EPHY_EMBED (widget)));
if (child)
gtk_widget_grab_focus (child);
@@ -776,14 +777,18 @@ static void
ephy_embed_constructed (GObject *object)
{
EphyEmbed *embed = (EphyEmbed*)object;
+ GtkWidget *scrolled_window;
WebKitWebView *web_view;
WebKitWebInspector *inspector;
GtkWidget *inspector_sw;
- embed->priv = EPHY_EMBED_GET_PRIVATE (embed);
+ scrolled_window = GTK_WIDGET (embed->priv->scrolled_window);
+ gtk_container_add (GTK_CONTAINER (embed), scrolled_window);
+ gtk_widget_show (scrolled_window);
+
web_view = WEBKIT_WEB_VIEW (ephy_web_view_new ());
embed->priv->web_view = web_view;
- gtk_container_add (GTK_CONTAINER (embed), GTK_WIDGET (web_view));
+ gtk_container_add (GTK_CONTAINER (embed->priv->scrolled_window), GTK_WIDGET (web_view));
gtk_widget_show (GTK_WIDGET (web_view));
g_object_connect (web_view,
@@ -832,7 +837,11 @@ ephy_embed_constructed (GObject *object)
static void
ephy_embed_init (EphyEmbed *embed)
{
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (embed),
+ embed->priv = EPHY_EMBED_GET_PRIVATE (embed);
+
+ embed->priv->scrolled_window = GTK_SCROLLED_WINDOW (gtk_scrolled_window_new (NULL, NULL));
+
+ gtk_scrolled_window_set_policy (embed->priv->scrolled_window,
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
}
diff --git a/embed/ephy-embed.h b/embed/ephy-embed.h
index 18fb6ed0a..bb32af04a 100644
--- a/embed/ephy-embed.h
+++ b/embed/ephy-embed.h
@@ -41,14 +41,14 @@ typedef struct EphyEmbed EphyEmbed;
typedef struct EphyEmbedPrivate EphyEmbedPrivate;
struct EphyEmbed {
- GtkScrolledWindow parent_instance;
+ GtkVBox parent_instance;
/*< private >*/
EphyEmbedPrivate *priv;
};
struct EphyEmbedClass {
- GtkScrolledWindowClass parent_class;
+ GtkVBoxClass parent_class;
};
GType ephy_embed_get_type (void);
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index a4dceb8f5..df7639c9b 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -236,7 +236,7 @@ popups_manager_hide (EphyEmbedContainer *container,
embed = ephy_embed_container_get_active_child (container);
g_return_if_fail (EPHY_IS_EMBED (embed));
- location = ephy_web_view_get_location (EPHY_GET_EPHY_WEB_VIEW_FROM_EMBED (embed), TRUE);
+ location = ephy_web_view_get_location (ephy_embed_get_web_view (embed), TRUE);
if (location == NULL) return;
features = popups_manager_new_window_info (container);