Commit 9ab1ab5f authored by Florian Müllner's avatar Florian Müllner

userList: Stop using a stack

By using a modal popover, the user list has now become a lot more
temporary. As a result, there is no longer a need for transitioning
between different lists on room switches, so we can just add the
correct list to the popover instead of keeping all lists around in
a stack. As GtkStack does a rather poor job at not propagating state
to non-visible children, this speeds up the UI significantly.

https://bugzilla.gnome.org/show_bug.cgi?id=727039
parent cf953db8
......@@ -69,10 +69,6 @@ const UserListPopover = new Lang.Class({
}));
frame.add(this._entry);
this._stack = new Gtk.Stack({ hexpand: true, vexpand: true });
this._stack.transition_type = Gtk.StackTransitionType.CROSSFADE;
this._box.add(this._stack);
this._box.show_all();
},
......@@ -83,8 +79,6 @@ const UserListPopover = new Lang.Class({
let userList = new UserList(room);
this._rooms[room.id] = userList;
this._stack.add_named(userList.widget, room.id);
userList.widget.vadjustment.connect('changed',
Lang.bind(this, this._updateEntryVisibility));
},
......@@ -100,12 +94,16 @@ const UserListPopover = new Lang.Class({
this._entry.text = '';
this._updateFilter();
let currentList = this._room ? this._rooms[this._room.id] : null;
if (currentList)
this._box.remove(currentList.widget);
this._room = room;
if (!room || !this._rooms[room.id])
return;
this._stack.set_visible_child_name(room.id);
this._box.add(this._rooms[room.id].widget);
this._updateEntryVisibility();
},
......@@ -325,7 +323,7 @@ const UserList = new Lang.Class({
Name: 'UserList',
_init: function(room) {
this.widget = new Gtk.ScrolledWindow();
this.widget = new Gtk.ScrolledWindow({ hexpand: true, vexpand: true });
this.widget.hscrollbar_policy = Gtk.PolicyType.NEVER;
this._list = new Gtk.ListBox();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment