[Xfce4-commits] [xfce/libxfce4ui] 03/05: Fix a crash in xfce_dialog_show_help_with_version

noreply at xfce.org noreply at xfce.org
Mon Jun 6 15:02:08 CEST 2016


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository xfce/libxfce4ui.

commit a40d23970a225626b4519effc033d474ef72f664
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Mon Jun 6 07:58:33 2016 +0300

    Fix a crash in xfce_dialog_show_help_with_version
    
    It was messing around with the internals of the GtkMessageDialog
    but we're just a GtkDialog now.
---
 libxfce4ui/libxfce4ui-dialog-ui.ui |  4 ++++
 libxfce4ui/xfce-dialogs.c          | 21 +++++++++++----------
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/libxfce4ui/libxfce4ui-dialog-ui.ui b/libxfce4ui/libxfce4ui-dialog-ui.ui
index 73ff28e..c590266 100644
--- a/libxfce4ui/libxfce4ui-dialog-ui.ui
+++ b/libxfce4ui/libxfce4ui-dialog-ui.ui
@@ -50,6 +50,10 @@
               <object class="GtkBox" id="label-box">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="margin_left">4</property>
+                <property name="margin_right">4</property>
+                <property name="margin_top">4</property>
+                <property name="margin_bottom">4</property>
                 <property name="orientation">vertical</property>
                 <property name="spacing">1</property>
                 <child>
diff --git a/libxfce4ui/xfce-dialogs.c b/libxfce4ui/xfce-dialogs.c
index 24464ed..be4d981 100644
--- a/libxfce4ui/xfce-dialogs.c
+++ b/libxfce4ui/xfce-dialogs.c
@@ -273,24 +273,25 @@ xfce_dialog_show_help_with_version (GtkWindow   *parent,
                                     GTK_RESPONSE_NO,
                                     XFCE_BUTTON_TYPE_MIXED,
 #if !GTK_CHECK_VERSION (3, 10, 0)
-                                        GTK_STOCK_HELP,
+                                    GTK_STOCK_HELP,
 #else
-                                        "help-browser",
+                                    "help-browser",
 #endif
-                                        _("_Read Online"),
-                                        GTK_RESPONSE_YES,
+                                    _("_Read Online"),
+                                    GTK_RESPONSE_YES,
                                     NULL);
   g_free (primary);
 
-#if GTK_CHECK_VERSION (2, 22, 0)
-  message_box = gtk_message_dialog_get_message_area (GTK_MESSAGE_DIALOG (dialog));
-#else
-  message_box = gtk_widget_get_parent (GTK_MESSAGE_DIALOG (dialog)->label);
-  g_return_if_fail (GTK_IS_VBOX (message_box));
-#endif
+
+  message_box = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+  g_return_if_fail (GTK_IS_BOX (message_box));
 
   button = gtk_check_button_new_with_mnemonic (_("_Always go directly to the online documentation"));
   gtk_box_pack_end (GTK_BOX (message_box), button, FALSE, TRUE, 0);
+#if GTK_CHECK_VERSION (3, 0, 0)
+  g_object_set (G_OBJECT (button), "halign", GTK_ALIGN_END, "margin-start", 8, "margin-end", 8, NULL);
+  gtk_widget_set_hexpand (button, TRUE);
+#endif
   g_signal_connect (G_OBJECT (button), "toggled",
       G_CALLBACK (xfce_dialog_show_help_auto_toggled), NULL);
   gtk_widget_show (button);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list