summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-06-27 19:54:07 +0200
committerraveit65 <[email protected]>2016-07-06 17:47:42 +0200
commit60efc5224fd7768ee100c248660338607f8ecf15 (patch)
treefe31ddc6193b242642f364506128074856113b1e
parentf02d495258535739320e340f809f1e8392aca7af (diff)
downloadcaja-60efc5224fd7768ee100c248660338607f8ecf15.tar.bz2
caja-60efc5224fd7768ee100c248660338607f8ecf15.tar.xz
GTK+-3 file-conflict-dialog: use widget properties instead of GtkAlignment
GtkAlignment has been deprecated since GTK+ 3.14 and the use of halign, valign and margin properties is encouraged. This commit aligns widgets by use of said properties instead of the GtkAlignment widget. taken from: https://git.gnome.org/browse/nautilus/commit/?id=470235f
-rw-r--r--libcaja-private/caja-file-conflict-dialog.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libcaja-private/caja-file-conflict-dialog.c b/libcaja-private/caja-file-conflict-dialog.c
index 6031e27a..531ac8c7 100644
--- a/libcaja-private/caja-file-conflict-dialog.c
+++ b/libcaja-private/caja-file-conflict-dialog.c
@@ -584,7 +584,11 @@ diff_button_clicked_cb (GtkButton *w,
static void
caja_file_conflict_dialog_init (CajaFileConflictDialog *fcd)
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GtkWidget *hbox, *vbox, *vbox2;
+#else
GtkWidget *hbox, *vbox, *vbox2, *alignment;
+#endif
GtkWidget *widget, *dialog_area;
CajaFileConflictDialogDetails *details;
GtkDialog *dialog;
@@ -619,11 +623,19 @@ caja_file_conflict_dialog_init (CajaFileConflictDialog *fcd)
details->titles_vbox = widget;
/* Setup the hboxes to pack file infos into */
+#if GTK_CHECK_VERSION (3, 0, 0)
+ vbox2 = gtk_vbox_new (FALSE, 12);
+ gtk_widget_set_halign (vbox2, GTK_ALIGN_START);
+ gtk_widget_set_valign (vbox2, GTK_ALIGN_START);
+ gtk_widget_set_margin_start (vbox2, 12);
+ gtk_box_pack_start (GTK_BOX (vbox), vbox2, FALSE, FALSE, 0);
+#else
alignment = gtk_alignment_new (0.0, 0.0, 0.0, 0.0);
g_object_set (alignment, "left-padding", 12, NULL);
vbox2 = gtk_vbox_new (FALSE, 12);
gtk_container_add (GTK_CONTAINER (alignment), vbox2);
gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
+#endif
hbox = gtk_hbox_new (FALSE, 12);
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
@@ -656,7 +668,11 @@ caja_file_conflict_dialog_init (CajaFileConflictDialog *fcd)
g_signal_connect (widget, "clicked",
G_CALLBACK (reset_button_clicked_cb), dialog);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_show_all (vbox2);
+#else
gtk_widget_show_all (alignment);
+#endif
/* Setup the diff button for text files */
details->diff_button = gtk_button_new_with_label (_("Differences..."));