[polari/wip/fmuellner/window-experiments: 12/29] mainWindow: Initialize sidebar visibility
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/fmuellner/window-experiments: 12/29] mainWindow: Initialize sidebar visibility
- Date: Tue, 19 Jul 2016 22:37:34 +0000 (UTC)
commit f064db192e55370090457e66e0ea2202a522335c
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Jul 14 17:54:51 2016 +0200
mainWindow: Initialize sidebar visibility
The code currently assumes that the window is created before accounts
are initialized, which won't be true for windows that are opened at a
later point once we allow multiple windows, so make sure the sidebar's
visibility is properly initialized.
src/mainWindow.js | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index dfe6ca2..c2e284c 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -156,13 +156,9 @@ const MainWindow = new Lang.Class({
}));
this._accountsMonitor = AccountsMonitor.getDefault();
- this._accountsMonitor.connect('accounts-changed', Lang.bind(this,
- function(am) {
- let accounts = am.dupAccounts();
- this._roomListRevealer.reveal_child = accounts.some(function(a) {
- return a.enabled;
- });
- }));
+ this._accountsMonitor.connect('accounts-changed',
+ Lang.bind(this, this._onAccountsChanged));
+ this._onAccountsChanged(this._accountsMonitor);
this._roomManager = ChatroomManager.getDefault();
this._roomManager.connect('active-changed',
@@ -230,6 +226,11 @@ const MainWindow = new Lang.Class({
GLib.Variant.new('ai', this._currentSize));
},
+ _onAccountsChanged: function(am) {
+ let accounts = am.dupAccounts();
+ this._roomListRevealer.reveal_child = accounts.some(a => a.enabled);
+ },
+
_updateDecorations: function() {
let layoutLeft = null;
let layoutRight = null;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]