[gnome-music] UI: better Empty state



commit a24006541556508942f71a1378a63fdbdeb1e0b5
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Fri Jan 23 13:19:24 2015 +0100

    UI: better Empty state

 data/NoMusic.ui    |   15 +++++++++------
 gnomemusic/view.py |    6 ++++++
 2 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/data/NoMusic.ui b/data/NoMusic.ui
index 21b85de..d89d91d 100644
--- a/data/NoMusic.ui
+++ b/data/NoMusic.ui
@@ -3,7 +3,7 @@
   <!-- interface-requires gtk+ 3.0 -->
   <object class="GtkBox" id="container">
     <property name="visible">True</property>
-    <property name="orientation">horizontal</property>
+    <property name="orientation">vertical</property>
     <property name="can_focus">False</property>
     <property name="halign">center</property>
     <property name="valign">center</property>
@@ -12,10 +12,11 @@
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="valign">center</property>
-        <property name="pixel_size">80</property>
+        <property name="pixel_size">128</property>
         <property name="icon_name">emblem-music-symbolic</property>
         <property name="opacity">0.2</property>
         <property name="icon-size">0</property>
+        <property name="margin-bottom">18</property>
       </object>
       <packing>
         <property name="expand">False</property>
@@ -26,15 +27,15 @@
     <child>
       <object class="GtkBox" id="label">
         <property name="orientation">vertical</property>
-        <property name="margin">10</property>
         <child>
           <object class="GtkLabel" id="label1">
             <property name="visible">True</property>
             <property name="opacity">0.5</property>
             <property name="can_focus">False</property>
             <property name="label" translatable="yes">No music found</property>
-            <property name="justify">left</property>
+            <property name="halign">center</property>
             <property name="xalign">0</property>
+            <property name="margin-bottom">12</property>
             <attributes>
               <attribute name="weight" value="bold"/>
               <attribute name="scale" value="2"/>
@@ -47,12 +48,14 @@
           </packing>
         </child>
         <child>
-          <object class="GtkLabel" id="label2">
+          <object class="GtkLabel" id="empty-state-label">
             <property name="visible">True</property>
             <property name="opacity">0.5</property>
             <property name="can_focus">False</property>
-            <property name="label" translatable="yes">The contents of your music folder will appear 
here.</property>
+            <!-- Translators: %s will be replaced with a link with text 'Music folder' -->
+            <property name="label" translatable="yes">The contents of your %s will appear here.</property>
             <property name="justify">left</property>
+            <property name="use_markup">true</property>
           </object>
           <packing>
             <property name="expand">False</property>
diff --git a/gnomemusic/view.py b/gnomemusic/view.py
index ea1d70c..b19f5d7 100644
--- a/gnomemusic/view.py
+++ b/gnomemusic/view.py
@@ -269,9 +269,15 @@ class Empty(Gtk.Stack):
         builder = Gtk.Builder()
         builder.add_from_resource('/org/gnome/Music/NoMusic.ui')
         widget = builder.get_object('container')
+        self.update_empty_state_link(builder)
         self.add(widget)
         self.show_all()
 
+    def update_empty_state_link(self, builder):
+        label = builder.get_object('empty-state-label')
+        href_text = '<a href="%s">%s</a>' % (Query.MUSIC_URI, _("Music folder"))
+        label.set_label(label.get_label() % href_text)
+
 
 class Albums(ViewContainer):
     @log


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