[gnome-shell/wip/fmuellner/calendar-refresh: 4/12] messageList: Make canClear public and notify on changes
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/fmuellner/calendar-refresh: 4/12] messageList: Make canClear public and notify on changes
- Date: Tue, 28 Feb 2017 19:39:29 +0000 (UTC)
commit 12fadfd7f3b1cd2d510e74f623986a1c99d371c4
Author: Florian Müllner <fmuellner gnome org>
Date: Sun Feb 26 22:23:11 2017 +0100
messageList: Make canClear public and notify on changes
The latest mockups contain a button to clear all sections at once.
As some elements cannot be cleared, we need to provide that information
to avoid offering an action that has no effect.
https://bugzilla.gnome.org/show_bug.cgi?id=775763
js/ui/messageList.js | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/messageList.js b/js/ui/messageList.js
index 325f5a3..9dde309 100644
--- a/js/ui/messageList.js
+++ b/js/ui/messageList.js
@@ -563,6 +563,7 @@ const MessageListSection = new Lang.Class({
this._messages = new Map();
this._date = new Date();
this.empty = true;
+ this.canClear = false;
this._sync();
},
@@ -719,7 +720,14 @@ const MessageListSection = new Lang.Class({
if (changed)
this.emit('empty-changed');
- this._closeButton.visible = this._canClear();
+ let canClear = this._canClear();
+ changed = this.canClear !== canClear;
+ this.canClear = canClear;
+
+ if (changed)
+ this.emit('can-clear-changed');
+
+ this._closeButton.visible = this.canClear;
this.actor.visible = this.allowed && this._shouldShow();
}
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]