[epiphany] ephy-web-view: don't use set-scroll-adjustments signal
- From: Xan Lopez <xan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] ephy-web-view: don't use set-scroll-adjustments signal
- Date: Sun, 24 Oct 2010 08:22:17 +0000 (UTC)
commit 90f545eba59c0ecf1ea6924d909630e9a9b564c6
Author: Xan Lopez <xan gnome org>
Date: Sun Oct 24 17:21:26 2010 +0900
ephy-web-view: don't use set-scroll-adjustments signal
Instead rely on notify::{h,v}adjustment
embed/ephy-web-view.c | 26 +++++++++++++++++++-------
1 files changed, 19 insertions(+), 7 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index ac68164..8252adc 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -2083,13 +2083,21 @@ adj_changed_cb (GtkAdjustment *adj, EphyWebView *view)
}
static void
-set_scroll_adjustments_cb (EphyWebView *view, GtkAdjustment *hadj, GtkAdjustment *vadj)
+hadjustment_changed_cb (EphyWebView *view, GParamSpec *pspec, gpointer data)
{
- if (hadj)
- g_signal_connect (hadj, "value-changed", G_CALLBACK (adj_changed_cb), view);
+ GtkAdjustment *adj = gtk_scrollable_get_hadjustment(GTK_SCROLLABLE(view));
- if (vadj)
- g_signal_connect (vadj, "value-changed", G_CALLBACK (adj_changed_cb), view);
+ if (adj)
+ g_signal_connect (adj, "value-changed", G_CALLBACK (adj_changed_cb), view);
+}
+
+static void
+vadjustment_changed_cb (EphyWebView *view, GParamSpec *pspec, gpointer data)
+{
+ GtkAdjustment *adj = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(view));
+
+ if (adj)
+ g_signal_connect (adj, "value-changed", G_CALLBACK (adj_changed_cb), view);
}
static void
@@ -2171,8 +2179,12 @@ ephy_web_view_init (EphyWebView *web_view)
G_CALLBACK (ge_popup_blocked_cb),
web_view, (GConnectFlags)0);
- g_signal_connect (web_view, "set-scroll-adjustments",
- G_CALLBACK (set_scroll_adjustments_cb),
+ g_signal_connect (web_view, "notify::hadjustment",
+ G_CALLBACK (hadjustment_changed_cb),
+ NULL);
+
+ g_signal_connect (web_view, "notify::vadjustment",
+ G_CALLBACK (vadjustment_changed_cb),
NULL);
g_signal_connect (web_view, "notify::status-message",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]