[polari] roomList: Only animate spinner when visible
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] roomList: Only animate spinner when visible
- Date: Wed, 7 Oct 2015 14:48:21 +0000 (UTC)
commit f54e1bf492af55c0f59453aba8aa9882de15c673
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Oct 7 15:39:09 2015 +0200
roomList: Only animate spinner when visible
While the spinner is not drawn when a different stack child is shown, it
will still invalidate its area while active, which results in unnecessary
redraws.
data/resources/room-list-header.ui | 3 +--
src/roomList.js | 4 +++-
2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/data/resources/room-list-header.ui b/data/resources/room-list-header.ui
index 6cf945f..82b89c6 100644
--- a/data/resources/room-list-header.ui
+++ b/data/resources/room-list-header.ui
@@ -40,8 +40,7 @@
</packing>
</child>
<child>
- <object class="GtkSpinner">
- <property name="active">True</property>
+ <object class="GtkSpinner" id="spinner">
<property name="visible">True</property>
</object>
<packing>
diff --git a/src/roomList.js b/src/roomList.js
index 5106e23..dfba764 100644
--- a/src/roomList.js
+++ b/src/roomList.js
@@ -146,7 +146,8 @@ const RoomListHeader = new Lang.Class({
'iconStack',
'errorPopover',
'popoverLabel',
- 'popoverButton'],
+ 'popoverButton',
+ 'spinner'],
_init: function(params) {
this._account = params.account;
@@ -260,6 +261,7 @@ const RoomListHeader = new Lang.Class({
}
this.sensitive = isError;
this._iconStack.visible_child_name = child;
+ this._spinner.active = (child == 'connecting');
},
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]