[gnome-shell] calendar: Hide message list when all sections are disallowed
- From: Florian MĂźllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] calendar: Hide message list when all sections are disallowed
- Date: Tue, 3 Mar 2015 18:36:10 +0000 (UTC)
commit db4076b6977d9de41ccb8e73f3eb1cbe57ba0d75
Author: Florian MĂźllner <fmuellner gnome org>
Date: Tue Mar 3 02:04:37 2015 +0100
calendar: Hide message list when all sections are disallowed
If none of the sections is allowed to display anything, it doesn't
make sense to show the message list at all, so hide it in that case.
https://bugzilla.gnome.org/show_bug.cgi?id=745494
js/ui/calendar.js | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
index 1c47b74..e325a8d 100644
--- a/js/ui/calendar.js
+++ b/js/ui/calendar.js
@@ -1730,6 +1730,8 @@ const MessageList = new Lang.Class({
this._eventsSection = new EventsSection();
this._addSection(this._eventsSection);
+
+ Main.sessionMode.connect('updated', Lang.bind(this, this._sync));
},
_addSection: function(section) {
@@ -1772,7 +1774,15 @@ const MessageList = new Lang.Class({
},
_sync: function() {
- let showPlaceholder = [...this._sections.keys()].every(function(s) {
+ let sections = [...this._sections.keys()];
+ let visible = sections.some(function(s) {
+ return s.allowed;
+ });
+ this.actor.visible = visible;
+ if (!visible)
+ return;
+
+ let showPlaceholder = sections.every(function(s) {
return s.empty || !s.actor.visible;
});
this._placeholder.actor.visible = showPlaceholder;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]