summaryrefslogtreecommitdiff
path: root/src/eom-scroll-view.c
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2015-07-23 23:23:17 +0200
committerinfirit <[email protected]>2015-08-31 22:35:17 +0200
commit971e627c6f066393b282f5d0182daaa0084e6e9a (patch)
tree787495f052f3833ee475edd2a8d1fd9723bff570 /src/eom-scroll-view.c
parent56a21c86bb4cbe389a2448cafde621b8b9e5878c (diff)
downloadeom-971e627c6f066393b282f5d0182daaa0084e6e9a.tar.bz2
eom-971e627c6f066393b282f5d0182daaa0084e6e9a.tar.xz
GTK3: Fix deprecated GTK API usage
taken from: https://git.gnome.org/browse/eog/commit/?id=9bd1a07
Diffstat (limited to 'src/eom-scroll-view.c')
-rw-r--r--src/eom-scroll-view.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/eom-scroll-view.c b/src/eom-scroll-view.c
index fc87b5a..81d9d70 100644
--- a/src/eom-scroll-view.c
+++ b/src/eom-scroll-view.c
@@ -448,9 +448,15 @@ check_scrollbar_visibility (EomScrollView *view, GtkAllocation *alloc)
compute_scaled_size (view, priv->zoom, &img_width, &img_height);
/* this should work fairly well in this special case for scrollbars */
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_get_preferred_size (priv->hbar, &req, NULL);
+ bar_height = req.height;
+ gtk_widget_get_preferred_size (priv->vbar, &req, NULL);
+#else
gtk_widget_size_request (priv->hbar, &req);
bar_height = req.height;
gtk_widget_size_request (priv->vbar, &req);
+#endif
bar_width = req.width;
eom_debug_message (DEBUG_WINDOW, "Widget Size allocate: %i, %i Bar: %i, %i\n",
@@ -2481,7 +2487,11 @@ eom_scroll_view_init (EomScrollView *view)
G_CALLBACK (adjustment_changed_cb),
view);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ priv->hbar = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, priv->hadj);
+#else
priv->hbar = gtk_hscrollbar_new (priv->hadj);
+#endif
priv->vadj = GTK_ADJUSTMENT (gtk_adjustment_new (0, 100, 0, 10, 10, 100));
g_signal_connect (priv->vadj, "value_changed",
G_CALLBACK (adjustment_changed_cb),