summaryrefslogtreecommitdiff
path: root/src/eom-print-image-setup.c
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2015-09-02 15:56:41 +0200
committerinfirit <[email protected]>2015-09-06 13:08:32 +0200
commit4a7304dcb64cd908a2e4e9c907efd5ad40d82a48 (patch)
tree690ce2246b1e495847f3abdb64ac9b6f198ffceb /src/eom-print-image-setup.c
parenta3362f16408b7d4e36c917e384dd346cc8cc40c4 (diff)
downloadeom-4a7304dcb64cd908a2e4e9c907efd5ad40d82a48.tar.bz2
eom-4a7304dcb64cd908a2e4e9c907efd5ad40d82a48.tar.xz
Gtk3: Drop GtkMisc and GtkAlignment usage
Both are deprecated and can be replaced by simple GtkWidget properties. This leaves out the dialogs made with Glade as it doesn't have support for the new margin-start property yet. taken from: https://git.gnome.org/browse/eog/commit/?id=2fad221
Diffstat (limited to 'src/eom-print-image-setup.c')
-rw-r--r--src/eom-print-image-setup.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/eom-print-image-setup.c b/src/eom-print-image-setup.c
index ee258b5..c8c0e46 100644
--- a/src/eom-print-image-setup.c
+++ b/src/eom-print-image-setup.c
@@ -648,11 +648,19 @@ static GtkWidget *
wrap_in_frame (const gchar *label,
GtkWidget *child)
{
+#if GTK_CHECK_VERSION (3, 14, 0)
+ GtkWidget *frame, *label_widget;
+#else
GtkWidget *frame, *alignment, *label_widget;
+#endif
gchar *bold_text;
label_widget = gtk_label_new ("");
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (label_widget, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (label_widget), 0.0, 0.5);
+#endif
gtk_widget_show (label_widget);
bold_text = g_markup_printf_escaped ("<b>%s</b>", label);
@@ -661,6 +669,13 @@ wrap_in_frame (const gchar *label,
frame = gtk_vbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (frame), label_widget, FALSE, FALSE, 0);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_box_pack_start (GTK_BOX (frame), child, FALSE, FALSE, 0);
+
+ gtk_widget_set_margin_start (child, 12);
+
+ gtk_widget_show (frame);
+#else
alignment = gtk_alignment_new (0.0, 0.0, 1.0, 1.0);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment),
@@ -671,6 +686,7 @@ wrap_in_frame (const gchar *label,
gtk_widget_show (frame);
gtk_widget_show (alignment);
+#endif
return frame;
}
@@ -687,7 +703,11 @@ table_attach_spin_button_with_label (GtkWidget *table,
GtkWidget *label, *spin_button;
label = gtk_label_new_with_mnemonic (text_label);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+#endif
spin_button = gtk_spin_button_new_with_range (0, 100, 0.01);
gtk_spin_button_set_digits (GTK_SPIN_BUTTON (spin_button), 2);
gtk_entry_set_width_chars (GTK_ENTRY (spin_button), 6);
@@ -917,7 +937,11 @@ eom_print_image_setup_init (EomPrintImageSetup *setup)
#endif
label = gtk_label_new_with_mnemonic (_("C_enter:"));
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+#endif
combobox = gtk_combo_box_text_new ();
gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (combobox),
@@ -1000,7 +1024,11 @@ eom_print_image_setup_init (EomPrintImageSetup *setup)
priv->scaling = hscale;
label = gtk_label_new_with_mnemonic (_("_Unit:"));
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+#endif
combobox = gtk_combo_box_text_new ();
gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (combobox), UNIT_MM,