Fix roomlist positioning when changing rooms
The room list is supposed to center the new room, but, since the current room as stored in SortFilterRoomTreeModel is only updated after we're jumping to the room, mostly just jumped to the old room.
This commit is contained in:
committed by
Tobias Fella
parent
ce82606e6e
commit
d9b495356d
@@ -96,7 +96,10 @@ Kirigami.Page {
|
||||
function onCurrentSpaceChanged() {
|
||||
treeView.expandRecursively();
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: RoomManager.sortFilterRoomTreeModel
|
||||
function onCurrentRoomChanged() {
|
||||
treeView.positionViewAtIndex(RoomManager.sortFilterRoomTreeModel.currentRoomIndex(), TableView.AlignVCenter)
|
||||
}
|
||||
|
||||
@@ -134,6 +134,7 @@ void SortFilterRoomTreeModel::setActiveSpaceId(const QString &spaceId)
|
||||
void SortFilterRoomTreeModel::setCurrentRoom(NeoChatRoom *room)
|
||||
{
|
||||
m_currentRoom = room;
|
||||
Q_EMIT currentRoomChanged();
|
||||
}
|
||||
|
||||
SortFilterRoomTreeModel::Mode SortFilterRoomTreeModel::mode() const
|
||||
|
||||
@@ -104,6 +104,7 @@ Q_SIGNALS:
|
||||
void filterTextChanged();
|
||||
void activeSpaceIdChanged();
|
||||
void modeChanged();
|
||||
void currentRoomChanged();
|
||||
|
||||
private:
|
||||
Mode m_mode = All;
|
||||
|
||||
Reference in New Issue
Block a user