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:
Tobias Fella
2025-07-07 16:38:55 +02:00
committed by Tobias Fella
parent ce82606e6e
commit d9b495356d
3 changed files with 5 additions and 0 deletions

View File

@@ -96,7 +96,10 @@ Kirigami.Page {
function onCurrentSpaceChanged() {
treeView.expandRecursively();
}
}
Connections {
target: RoomManager.sortFilterRoomTreeModel
function onCurrentRoomChanged() {
treeView.positionViewAtIndex(RoomManager.sortFilterRoomTreeModel.currentRoomIndex(), TableView.AlignVCenter)
}

View File

@@ -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

View File

@@ -104,6 +104,7 @@ Q_SIGNALS:
void filterTextChanged();
void activeSpaceIdChanged();
void modeChanged();
void currentRoomChanged();
private:
Mode m_mode = All;