summaryrefslogtreecommitdiff
path: root/eel
diff options
context:
space:
mode:
authorWolfgang Ulbrich <[email protected]>2016-01-23 00:04:15 +0100
committermonsta <[email protected]>2016-01-25 16:53:59 +0300
commit1241ff234a8ec46542e97e48a6298b78c9a0d2b5 (patch)
tree1a23419da4aea0392649d03888b3cc2621011851 /eel
parent130906c9182c71a6049eca472f8d3b91804124cf (diff)
downloadcaja-1241ff234a8ec46542e97e48a6298b78c9a0d2b5.tar.bz2
caja-1241ff234a8ec46542e97e48a6298b78c9a0d2b5.tar.xz
GTK3: fix deprecated GtkMisc
Diffstat (limited to 'eel')
-rw-r--r--eel/eel-gtk-extensions.c4
-rw-r--r--eel/eel-labeled-image.c22
2 files changed, 18 insertions, 8 deletions
diff --git a/eel/eel-gtk-extensions.c b/eel/eel-gtk-extensions.c
index 4e1bbeca..437723ea 100644
--- a/eel/eel-gtk-extensions.c
+++ b/eel/eel-gtk-extensions.c
@@ -483,8 +483,8 @@ eel_gtk_message_dialog_set_details_label (GtkMessageDialog *dialog,
label = gtk_label_new (details_text);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_selectable (GTK_LABEL (label), TRUE);
-#if GTK_CHECK_VERSION (3, 14, 0)
- gtk_widget_set_halign (label, GTK_ALIGN_START);
+#if GTK_CHECK_VERSION (3, 16, 0)
+ gtk_label_set_xalign (GTK_LABEL (label), 0);
#else
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
#endif
diff --git a/eel/eel-labeled-image.c b/eel/eel-labeled-image.c
index 2292978a..dbede43f 100644
--- a/eel/eel-labeled-image.c
+++ b/eel/eel-labeled-image.c
@@ -1102,8 +1102,13 @@ labeled_image_update_alignments (EelLabeledImage *labeled_image)
if (labeled_image->details->fill)
{
+#if GTK_CHECK_VERSION (3, 16, 0)
+ x_alignment = gtk_label_get_xalign (GTK_LABEL (labeled_image->details->label));
+ y_alignment = gtk_label_get_yalign (GTK_LABEL (labeled_image->details->label));
+#else
gtk_misc_get_alignment (GTK_MISC (labeled_image->details->label),
&x_alignment, &y_alignment);
+#endif
/* Only the label is shown */
if (!labeled_image_show_image (labeled_image))
@@ -1139,9 +1144,9 @@ labeled_image_update_alignments (EelLabeledImage *labeled_image)
}
-#if GTK_CHECK_VERSION (3, 14, 0)
- gtk_widget_set_halign (labeled_image->details->label, GTK_ALIGN_CENTER);
- gtk_widget_set_valign (labeled_image->details->label, GTK_ALIGN_CENTER);
+#if GTK_CHECK_VERSION (3, 16, 0)
+ gtk_label_set_xalign (GTK_LABEL (labeled_image->details->label), x_alignment);
+ gtk_label_set_yalign (GTK_LABEL (labeled_image->details->label), y_alignment);
#else
gtk_misc_set_alignment (GTK_MISC (labeled_image->details->label),
x_alignment,
@@ -1157,8 +1162,13 @@ labeled_image_update_alignments (EelLabeledImage *labeled_image)
if (labeled_image->details->fill)
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ x_alignment = gtk_widget_get_halign (labeled_image->details->image);
+ y_alignment = gtk_widget_get_valign (labeled_image->details->image);
+#else
gtk_misc_get_alignment (GTK_MISC (labeled_image->details->image),
&x_alignment, &y_alignment);
+#endif
/* Only the image is shown */
if (!labeled_image_show_label (labeled_image))
@@ -1193,9 +1203,9 @@ labeled_image_update_alignments (EelLabeledImage *labeled_image)
}
}
-#if GTK_CHECK_VERSION (3, 14, 0)
- gtk_widget_set_halign (labeled_image->details->image, GTK_ALIGN_CENTER);
- gtk_widget_set_valign (labeled_image->details->image, GTK_ALIGN_CENTER);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_set_halign (labeled_image->details->image, x_alignment);
+ gtk_widget_set_valign (labeled_image->details->image, y_alignment);
#else
gtk_misc_set_alignment (GTK_MISC (labeled_image->details->image),
x_alignment,