summaryrefslogtreecommitdiff
path: root/src/eom-print-image-setup.c
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2015-07-23 20:28:39 +0200
committerinfirit <[email protected]>2015-08-31 22:35:16 +0200
commit9d785e0f9ea5e08bd9bf0aac5edae3fe51482e31 (patch)
tree808e2e82cec9b4b8b6329a8a548fe7520aa60fd8 /src/eom-print-image-setup.c
parent2d5db548f1362d9d485c726b6cf7a05f69c04257 (diff)
downloadeom-9d785e0f9ea5e08bd9bf0aac5edae3fe51482e31.tar.bz2
eom-9d785e0f9ea5e08bd9bf0aac5edae3fe51482e31.tar.xz
GTK3: EomPrintImageSetup, Derive from GtkTable instead of GtkGrid
GtkTable has been deprecated in favor of GtkGrid. taken from: https://git.gnome.org/browse/eog/commit/?id=7fd3bcf
Diffstat (limited to 'src/eom-print-image-setup.c')
-rw-r--r--src/eom-print-image-setup.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/eom-print-image-setup.c b/src/eom-print-image-setup.c
index 6aa965b..8330e67 100644
--- a/src/eom-print-image-setup.c
+++ b/src/eom-print-image-setup.c
@@ -56,7 +56,11 @@
#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y)
#endif
+#if GTK_CHECK_VERSION (3, 4, 0)
+G_DEFINE_TYPE (EomPrintImageSetup, eom_print_image_setup, GTK_TYPE_GRID);
+#else
G_DEFINE_TYPE (EomPrintImageSetup, eom_print_image_setup, GTK_TYPE_TABLE);
+#endif
struct _EomPrintImageSetupPrivate {
GtkWidget *left;
@@ -873,9 +877,13 @@ eom_print_image_setup_init (EomPrintImageSetup *setup)
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
gtk_table_set_col_spacings (GTK_TABLE (table), 12);
frame = wrap_in_frame (_("Position"), table);
+#if GTK_CHECK_VERSION (3, 4, 0)
+ gtk_grid_attach (GTK_GRID (setup), frame, 0, 0, 1, 1);
+#else
gtk_table_attach (GTK_TABLE (setup), frame,
0, 1, 0, 1, GTK_FILL, 0,
0, 0);
+#endif
priv->left = table_attach_spin_button_with_label (table, _("_Left:"), 0, 0);
priv->right = table_attach_spin_button_with_label (table, _("_Right:"), 0, 1);
@@ -910,9 +918,13 @@ eom_print_image_setup_init (EomPrintImageSetup *setup)
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
gtk_table_set_col_spacings (GTK_TABLE (table), 12);
frame = wrap_in_frame (_("Size"), table);
+#if GTK_CHECK_VERSION (3, 4, 0)
+ gtk_grid_attach (GTK_GRID (setup), frame, 0, 1, 1, 1);
+#else
gtk_table_attach (GTK_TABLE (setup), frame,
0, 1, 1, 2, GTK_FILL, 0,
0, 0);
+#endif
priv->width = table_attach_spin_button_with_label (table, _("_Width:"),
0, 0);
@@ -970,9 +982,14 @@ eom_print_image_setup_init (EomPrintImageSetup *setup)
gtk_widget_set_size_request (priv->preview, 250, 250);
frame = wrap_in_frame (_("Preview"), priv->preview);
+#if GTK_CHECK_VERSION (3, 4, 0)
+ /* The preview widget needs to span the whole grid height */
+ gtk_grid_attach (GTK_GRID (setup), frame, 1, 0, 1, 2);
+#else
gtk_table_attach (GTK_TABLE (setup), frame,
1, 2, 0, 2, GTK_FILL, GTK_FILL,
0, 0);
+#endif
gtk_widget_show_all (GTK_WIDGET (setup));
}
@@ -997,9 +1014,13 @@ eom_print_image_setup_new (EomImage *image, GtkPageSetup *page_setup)
GtkWidget *preview;
setup = g_object_new (EOM_TYPE_PRINT_IMAGE_SETUP,
+#if GTK_CHECK_VERSION (3, 4, 0)
+ "orientation", GTK_ORIENTATION_VERTICAL,
+#else
"n-rows", 2,
"n-columns", 2,
"homogeneous", FALSE,
+#endif
"row-spacing", 18,
"column-spacing", 18,
"border-width", 12,