[gnome-books/wip/hadess/sensitive-menu: 5/5] overview: Add secondary label to empty state



commit 1deee62fe2bcc9822902ea839042171f91b5cd8d
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Aug 2 17:37:31 2019 +0200

    overview: Add secondary label to empty state
    
    As designed in:
    https://wiki.gnome.org/Design/OS/EmptyStates

 src/overview.js | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/overview.js b/src/overview.js
index d7463b51..18a51f1a 100644
--- a/src/overview.js
+++ b/src/overview.js
@@ -295,16 +295,24 @@ const EmptyResultsBox = new Lang.Class({
 
     _addSecondaryLabel: function() {
         let label;
+        let useMarkup = false;
 
         if (this._mode == WindowMode.WindowMode.SEARCH) {
             label = _("Try a different search");
         } else if (this._mode == WindowMode.WindowMode.COLLECTIONS) {
             label = _("You can create collections from the Books view");
         } else {
-            return;
+            let docsPath, docsUrl;
+
+            docsPath = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_DOCUMENTS);
+            docsUrl = Gio.file_new_for_path(docsPath).get_uri();
+            useMarkup = true;
+            /* translators: %s is the location of the Documents folder.*/
+            label = _('Books from your <a href="%s">Documents</a> folder will appear here').format(docsUrl);
         }
 
-        this.add(new Gtk.Label({ label: label }));
+        this.add(new Gtk.Label({ label: label,
+                                 use_markup: useMarkup }));
     }
 });
 


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