diff options
author | raveit65 <[email protected]> | 2016-07-30 14:30:54 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2016-08-31 16:14:15 +0200 |
commit | 3122424b75f05c522586bb7ced6a6bb638c5deb5 (patch) | |
tree | dc0841da8caa151f233c5258bc1d60a94e0d16e9 | |
parent | 222cefd36299d85575c3f11f5224b2241b325215 (diff) | |
download | pluma-3122424b75f05c522586bb7ced6a6bb638c5deb5.tar.bz2 pluma-3122424b75f05c522586bb7ced6a6bb638c5deb5.tar.xz |
GTK+-3 print-preview: avoid deprecated gtk_layout_get_{h/v}adjustment
replace it with gtk_scrollable_get_{h/v}adjustment
-rw-r--r-- | pluma/pluma-print-preview.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pluma/pluma-print-preview.c b/pluma/pluma-print-preview.c index 5a54e7fc..909fea81 100644 --- a/pluma/pluma-print-preview.c +++ b/pluma/pluma-print-preview.c @@ -262,10 +262,18 @@ set_zoom_fit_to_size (PlumaPrintPreview *preview) priv = preview->priv; +#if GTK_CHECK_VERSION (3, 0, 0) + g_object_get (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (priv->layout)), +#else g_object_get (gtk_layout_get_hadjustment (GTK_LAYOUT (priv->layout)), +#endif "page-size", &width, NULL); +#if GTK_CHECK_VERSION (3, 0, 0) + g_object_get (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (priv->layout)), +#else g_object_get (gtk_layout_get_vadjustment (GTK_LAYOUT (priv->layout)), +#endif "page-size", &height, NULL); @@ -733,8 +741,13 @@ get_page_at_coords (PlumaPrintPreview *preview, if (priv->tile_h <= 0 || priv->tile_h <= 0) return -1; +#if GTK_CHECK_VERSION (3, 0, 0) + hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (priv->layout)); + vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (priv->layout)); +#else hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (priv->layout)); vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (priv->layout)); +#endif x += gtk_adjustment_get_value (hadj); y += gtk_adjustment_get_value (vadj); @@ -795,8 +808,13 @@ preview_layout_key_press (GtkWidget *widget, priv = preview->priv; +#if GTK_CHECK_VERSION (3, 0, 0) + hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (priv->layout)); + vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (priv->layout)); +#else hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (priv->layout)); vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (priv->layout)); +#endif x = gtk_adjustment_get_value (hadj); y = gtk_adjustment_get_value (vadj); |