[goobox] properties dialog: use a GtkInfoBar to show messages



commit ac52b03046379b84a214b075cb24c7a2b058fd40
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Apr 14 12:57:10 2013 +0200

    properties dialog: use a GtkInfoBar to show messages

 src/dlg-properties.c |    6 ++--
 src/ui/properties.ui |   57 +++++++++++++++++++++++++++++++------------------
 2 files changed, 39 insertions(+), 24 deletions(-)
---
diff --git a/src/dlg-properties.c b/src/dlg-properties.c
index adaffb0..cc5fed1 100644
--- a/src/dlg-properties.c
+++ b/src/dlg-properties.c
@@ -269,8 +269,8 @@ search_album_by_title_ready_cb (GObject      *source_object,
        data->n_albums = g_list_length (data->albums);
 
        if (data->n_albums == 0) {
-               gtk_image_set_from_icon_name (GTK_IMAGE (GET_WIDGET ("info_icon")), 
_GTK_ICON_NAME_DIALOG_WARNING, GTK_ICON_SIZE_BUTTON);
                gtk_label_set_text (GTK_LABEL (GET_WIDGET ("info_label")), _("No album found"));
+               gtk_info_bar_set_message_type (GTK_INFO_BAR (GET_WIDGET ("info_box")), GTK_MESSAGE_WARNING);
                gtk_widget_show (GET_WIDGET ("info_box"));
                gtk_widget_hide (GET_WIDGET ("navigation_box"));
        }
@@ -288,8 +288,8 @@ search_cb (GtkWidget  *widget,
 
        data->searching = TRUE;
 
-       gtk_image_set_from_icon_name (GTK_IMAGE (GET_WIDGET ("info_icon")), "edit-find-symbolic", 
GTK_ICON_SIZE_BUTTON);
-       gtk_label_set_text (GTK_LABEL (GET_WIDGET ("info_label")), _("Searching disc info..."));
+       gtk_label_set_text (GTK_LABEL (GET_WIDGET ("info_label")), _("Searching disc information…"));
+       gtk_info_bar_set_message_type (GTK_INFO_BAR (GET_WIDGET ("info_box")), GTK_MESSAGE_INFO);
        gtk_widget_show (GET_WIDGET ("info_box"));
        gtk_widget_hide (GET_WIDGET ("navigation_box"));
 
diff --git a/src/ui/properties.ui b/src/ui/properties.ui
index 17e2e60..fca8b1d 100644
--- a/src/ui/properties.ui
+++ b/src/ui/properties.ui
@@ -316,47 +316,62 @@
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <child>
-                              <object class="GtkHBox" id="info_box">
+                              <object class="GtkInfoBar" id="info_box">
+                                <property name="app_paintable">True</property>
                                 <property name="can_focus">False</property>
-                                <child>
-                                  <object class="GtkHBox" id="hbox5">
+                                <property name="no_show_all">True</property>
+                                <property name="message_type">warning</property>
+                                <child internal-child="content_area">
+                                  <object class="GtkBox" id="infobar-content_area1">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
-                                    <property name="spacing">6</property>
-                                    <child>
-                                      <object class="GtkImage" id="info_icon">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <property name="icon_name">dialog-warning-symbolic</property>
-                                      </object>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="fill">False</property>
-                                        <property name="position">0</property>
-                                      </packing>
-                                    </child>
+                                    <property name="border_width">8</property>
+                                    <property name="spacing">16</property>
                                     <child>
                                       <object class="GtkLabel" id="info_label">
                                         <property name="visible">True</property>
                                         <property name="can_focus">False</property>
-                                        <property name="label" translatable="yes">No album found.</property>
+                                        <property name="label">No album found.</property>
                                       </object>
                                       <packing>
                                         <property name="expand">False</property>
                                         <property name="fill">False</property>
-                                        <property name="position">1</property>
+                                        <property name="position">0</property>
                                       </packing>
                                     </child>
                                   </object>
                                   <packing>
                                     <property name="expand">True</property>
-                                    <property name="fill">False</property>
+                                    <property name="fill">True</property>
                                     <property name="position">0</property>
                                   </packing>
                                 </child>
+                                <child internal-child="action_area">
+                                  <object class="GtkButtonBox" id="infobar-action_area1">
+                                    <property name="can_focus">False</property>
+                                    <property name="border_width">5</property>
+                                    <property name="orientation">vertical</property>
+                                    <property name="spacing">6</property>
+                                    <property name="layout_style">end</property>
+                                    <child>
+                                      <placeholder/>
+                                    </child>
+                                    <child>
+                                      <placeholder/>
+                                    </child>
+                                    <child>
+                                      <placeholder/>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
                               </object>
                               <packing>
-                                <property name="expand">False</property>
+                                <property name="expand">True</property>
                                 <property name="fill">True</property>
                                 <property name="position">0</property>
                               </packing>
@@ -439,7 +454,7 @@
                           </object>
                           <packing>
                             <property name="expand">True</property>
-                            <property name="fill">False</property>
+                            <property name="fill">True</property>
                             <property name="pack_type">end</property>
                             <property name="position">0</property>
                           </packing>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]