[gnome-books/wip/hadess/sensitive-menu: 4/5] overview: Make secondary label function extensible
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-books/wip/hadess/sensitive-menu: 4/5] overview: Make secondary label function extensible
- Date: Fri, 2 Aug 2019 15:38:28 +0000 (UTC)
commit 0101ef76919d1e067b53377f2acb62f05a19dde5
Author: Bastien Nocera <hadess hadess net>
Date: Fri Aug 2 17:30:48 2019 +0200
overview: Make secondary label function extensible
src/overview.js | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/src/overview.js b/src/overview.js
index 36599627..d7463b51 100644
--- a/src/overview.js
+++ b/src/overview.js
@@ -294,18 +294,17 @@ const EmptyResultsBox = new Lang.Class({
},
_addSecondaryLabel: function() {
- if (this._mode == WindowMode.WindowMode.SEARCH) {
- this.add(new Gtk.Label({ label: _("Try a different search") }));
- return;
- }
+ let label;
- if (this._mode == WindowMode.WindowMode.COLLECTIONS) {
- let label;
+ 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");
-
- this.add(new Gtk.Label({ label: label }));
+ } else {
return;
}
+
+ this.add(new Gtk.Label({ label: label }));
}
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]