Blame SOURCES/0251-Replacing-gtk_misc_set_alignment-and-gtk_misc_set_pa.patch

b12e4c
From 17f29c0c1f28e78578e8696a4464dd53ec9de5b9 Mon Sep 17 00:00:00 2001
b12e4c
From: =?UTF-8?q?Mat=C4=9Bj=20Kudera?= <matejkudera1@seznam.cz>
b12e4c
Date: Tue, 23 May 2017 14:14:38 +0200
b12e4c
Subject: [PATCH] Replacing 'gtk_misc_set_alignment' and 'gtk_misc_set_padding'
b12e4c
b12e4c
Removing if command which handled old versions of dtk-3 because old versions of dtk-3 are now used nowhere.
b12e4c
gtk_misc_set_alignment replaced with gtk_widget_set_halign, gtk_widget_set_valign.
b12e4c
gtk_misc_set_padding replaced with alignment and margin properties.
b12e4c
---
b12e4c
 src/gtk-helpers/autowrapped_label.c   |  5 +++--
b12e4c
 src/gtk-helpers/event_config_dialog.c | 20 ++++++--------------
b12e4c
 src/gui-wizard-gtk/wizard.c           | 11 +++--------
b12e4c
 3 files changed, 12 insertions(+), 24 deletions(-)
b12e4c
b12e4c
diff --git a/src/gtk-helpers/autowrapped_label.c b/src/gtk-helpers/autowrapped_label.c
b12e4c
index b56391c..9abaf82 100644
b12e4c
--- a/src/gtk-helpers/autowrapped_label.c
b12e4c
+++ b/src/gtk-helpers/autowrapped_label.c
b12e4c
@@ -61,8 +61,9 @@ static void rewrap_label_to_parent_size(GtkWidget *widget,
b12e4c
 void make_label_autowrap_on_resize(GtkLabel *label)
b12e4c
 {
b12e4c
     // So far, only tested to work on labels which were set up as:
b12e4c
-    //gtk_label_set_justify(label, GTK_JUSTIFY_LEFT);
b12e4c
-    //gtk_misc_set_alignment(GTK_MISC(label), /*x,yalign:*/ 0.0, 0.0);
b12e4c
+    // gtk_label_set_justify(label, GTK_JUSTIFY_LEFT);
b12e4c
+    // gtk_widget_set_halign (label, GTK_ALIGN_START);
b12e4c
+    // gtk_widget_set_valign (label, GTK_ALIGN_END);
b12e4c
     // yalign != 0 definitely breaks things!
b12e4c
     // also, <property name="ypad">NONZERO</property> would be bad
b12e4c
 
b12e4c
diff --git a/src/gtk-helpers/event_config_dialog.c b/src/gtk-helpers/event_config_dialog.c
b12e4c
index 590a2ed..c5c0c41 100644
b12e4c
--- a/src/gtk-helpers/event_config_dialog.c
b12e4c
+++ b/src/gtk-helpers/event_config_dialog.c
b12e4c
@@ -35,16 +35,12 @@ static GtkWidget *gtk_label_new_justify_left(const gchar *label_str)
b12e4c
 {
b12e4c
     GtkWidget *label = gtk_label_new(label_str);
b12e4c
     gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
b12e4c
-#if ((GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 13) || (GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION == 13 && GTK_MICRO_VERSION < 5))
b12e4c
-    gtk_misc_set_alignment(GTK_MISC(label), /*xalign:*/ 0, /*yalign:*/ 0.5);
b12e4c
-    /* Make some space between label and input field to the right of it: */
b12e4c
-    gtk_misc_set_padding(GTK_MISC(label), /*xpad:*/ 5, /*ypad:*/ 0);
b12e4c
-#else
b12e4c
+
b12e4c
     gtk_widget_set_halign (label, GTK_ALIGN_START);
b12e4c
     /* Make some space between label and input field to the right of it: */
b12e4c
     gtk_widget_set_margin_start(label, 5);
b12e4c
     gtk_widget_set_margin_end(label, 5);
b12e4c
-#endif
b12e4c
+
b12e4c
     return label;
b12e4c
 }
b12e4c
 
b12e4c
@@ -153,12 +149,10 @@ static void add_option_to_table(gpointer data, gpointer user_data)
b12e4c
         case OPTION_TYPE_HINT_HTML:
b12e4c
             label = gtk_label_new(option_label);
b12e4c
             gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
b12e4c
-#if ((GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 13) || (GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION == 13 && GTK_MICRO_VERSION < 5))
b12e4c
-            gtk_misc_set_alignment(GTK_MISC(label), /*x,yalign:*/ 0.0, 0.0);
b12e4c
-#else
b12e4c
+
b12e4c
             gtk_widget_set_halign(label, GTK_ALIGN_START);
b12e4c
             gtk_widget_set_valign(label, GTK_ALIGN_START);
b12e4c
-#endif
b12e4c
+
b12e4c
             make_label_autowrap_on_resize(GTK_LABEL(label));
b12e4c
 
b12e4c
             last_row = add_one_row_to_grid(option_table);
b12e4c
@@ -190,12 +184,10 @@ static void add_option_to_table(gpointer data, gpointer user_data)
b12e4c
     {
b12e4c
         label = gtk_label_new(option->eo_note_html);
b12e4c
         gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
b12e4c
-#if ((GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 13) || (GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION == 13 && GTK_MICRO_VERSION < 5))
b12e4c
-        gtk_misc_set_alignment(GTK_MISC(label), /*x,yalign:*/ 0.0, 0.0);
b12e4c
-#else
b12e4c
+
b12e4c
         gtk_widget_set_halign(label, GTK_ALIGN_START);
b12e4c
         gtk_widget_set_valign(label, GTK_ALIGN_START);
b12e4c
-#endif
b12e4c
+
b12e4c
         make_label_autowrap_on_resize(GTK_LABEL(label));
b12e4c
 
b12e4c
         last_row = add_one_row_to_grid(option_table);
b12e4c
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
b12e4c
index 8df71c9..b98ecea 100644
b12e4c
--- a/src/gui-wizard-gtk/wizard.c
b12e4c
+++ b/src/gui-wizard-gtk/wizard.c
b12e4c
@@ -1072,12 +1072,10 @@ static event_gui_data_t *add_event_buttons(GtkBox *box,
b12e4c
     if (!event_name || !event_name[0])
b12e4c
     {
b12e4c
         GtkWidget *lbl = gtk_label_new(_("No reporting targets are defined for this problem. Check configuration in /etc/libreport/*"));
b12e4c
-#if ((GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 13) || (GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION == 13 && GTK_MICRO_VERSION < 5))
b12e4c
-        gtk_misc_set_alignment(GTK_MISC(lbl), /*x*/ 0.0, /*y*/ 0.0);
b12e4c
-#else
b12e4c
+
b12e4c
         gtk_widget_set_halign (lbl, GTK_ALIGN_START);
b12e4c
         gtk_widget_set_valign (lbl, GTK_ALIGN_END);
b12e4c
-#endif
b12e4c
+
b12e4c
         make_label_autowrap_on_resize(GTK_LABEL(lbl));
b12e4c
         gtk_box_pack_start(box, lbl, /*expand*/ true, /*fill*/ false, /*padding*/ 0);
b12e4c
         return NULL;
b12e4c
@@ -2266,12 +2264,9 @@ static void add_warning(const char *warning)
b12e4c
     /* should be safe to free it, gtk calls strdup() to copy it */
b12e4c
     free(label_str);
b12e4c
 
b12e4c
-#if ((GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 13) || (GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION == 13 && GTK_MICRO_VERSION < 5))
b12e4c
-    gtk_misc_set_alignment(GTK_MISC(warning_lbl), 0.0, 0.0);
b12e4c
-#else
b12e4c
     gtk_widget_set_halign (warning_lbl, GTK_ALIGN_START);
b12e4c
     gtk_widget_set_valign (warning_lbl, GTK_ALIGN_END);
b12e4c
-#endif
b12e4c
+
b12e4c
     gtk_label_set_justify(GTK_LABEL(warning_lbl), GTK_JUSTIFY_LEFT);
b12e4c
     gtk_label_set_line_wrap(GTK_LABEL(warning_lbl), TRUE);
b12e4c
 
b12e4c
-- 
b12e4c
2.21.0
b12e4c