[Xfce4-commits] [xfce/libxfce4ui] 05/28: xfce-dialogs: Use GtkMessageDialog as base class

noreply at xfce.org noreply at xfce.org
Thu Jan 9 23:31:48 CET 2020


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

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/libxfce4ui.

commit 36ff341a043fbdddd227f17f00ba1458b455e9b8
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Fri Jan 3 23:54:32 2020 +0100

    xfce-dialogs: Use GtkMessageDialog as base class
    
    While the documentation advertised the widgets returned by
    xfce_message_dialog_* as type GtkMessageDialog they were in fact
    GtkDialogs. This commit switches to GtkMessageDialog.
---
 libxfce4ui/libxfce4ui-dialog-ui.ui | 14 ++------------
 libxfce4ui/xfce-dialogs.c          |  9 ++++++++-
 2 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/libxfce4ui/libxfce4ui-dialog-ui.ui b/libxfce4ui/libxfce4ui-dialog-ui.ui
index 476ed60..f666586 100644
--- a/libxfce4ui/libxfce4ui-dialog-ui.ui
+++ b/libxfce4ui/libxfce4ui-dialog-ui.ui
@@ -2,19 +2,9 @@
 <!-- Generated with glade 3.18.3 -->
 <interface>
   <requires lib="gtk+" version="3.12"/>
-  <object class="GtkDialog" id="xfce4ui-dialog">
+  <object class="GtkMessageDialog" id="xfce4ui-dialog">
     <property name="can_focus">False</property>
-    <property name="type_hint">dialog</property>
-    <child type="titlebar">
-      <object class="GtkHeaderBar">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="show_close_button">True</property>
-        <child>
-          <placeholder/>
-        </child>
-      </object>
-    </child>
+    <property name="message_type">GTK_MESSAGE_OTHER</property>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
         <property name="can_focus">False</property>
diff --git a/libxfce4ui/xfce-dialogs.c b/libxfce4ui/xfce-dialogs.c
index 506a018..7fb4a08 100644
--- a/libxfce4ui/xfce-dialogs.c
+++ b/libxfce4ui/xfce-dialogs.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2006-2007 Benedikt Meurer <benny at xfce.org>
- * Copyright (c) 2007      The Xfce Development Team
+ * Copyright (c) 2019      The Xfce Development Team
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -584,6 +584,7 @@ xfce_message_dialog_new_valist (GtkWindow   *parent,
   GtkWidget   *dialog_image;
   GtkWidget   *image;
   GtkWidget   *button;
+  GtkWidget   *content_area;
   GtkWidget   *label_box;
   const gchar *text = first_button_text;
   const gchar *label;
@@ -591,6 +592,7 @@ xfce_message_dialog_new_valist (GtkWindow   *parent,
   gint         response;
   GdkPixbuf   *pixbuf, *scaled;
   gint         w, h;
+  GList       *children;
 
   g_return_val_if_fail (primary_text != NULL || secondary_text != NULL, NULL);
   g_return_val_if_fail (parent == NULL || GTK_IS_WINDOW (parent), NULL);
@@ -603,6 +605,11 @@ xfce_message_dialog_new_valist (GtkWindow   *parent,
   dialog_image = GTK_WIDGET(gtk_builder_get_object(gxml, "icon_stock_id"));
   gtk_window_set_default_size (GTK_WINDOW (dialog), 500, -1);
 
+  /* Remove the original message area of the GtkMessageDialog as we add our own */
+  content_area = GTK_WIDGET (gtk_dialog_get_content_area (GTK_DIALOG (dialog)));
+  children = gtk_container_get_children (GTK_CONTAINER (content_area));
+  gtk_container_remove (GTK_CONTAINER (content_area), GTK_WIDGET ((g_list_nth (children, 1))->data));
+
   if (parent)
     {
       gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);

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


More information about the Xfce4-commits mailing list