Updated room sorting

Change the LastActivity sort order to Activity and update to a more flexible way of sorting based on an order from model roles.
Add options to actually switch between Alphabetical and Activity

Based on some old work by @tdfischer 

implements #103
This commit is contained in:
James Graham
2024-02-28 17:57:32 +00:00
parent 0c24996b44
commit 1ae3fc86da
7 changed files with 107 additions and 43 deletions

View File

@@ -65,6 +65,29 @@ FormCard.FormCardPage {
}
}
}
FormCard.FormHeader {
title: i18n("Room list sort order")
}
FormCard.FormCard {
FormCard.FormRadioDelegate {
text: i18nc("As in 'sort something based on last activity'", "Activity")
checked: Config.sortOrder === 1
enabled: !Config.isSortOrderImmutable
onToggled: {
Config.sortOrder = 1
Config.save()
}
}
FormCard.FormRadioDelegate {
text: i18nc("As in 'sort something alphabetically'", "Alphabetical")
checked: Config.sortOrder === 0
enabled: !Config.isSortOrderImmutable
onToggled: {
Config.sortOrder = 0
Config.save()
}
}
}
FormCard.FormHeader {
title: i18n("Timeline Events")
}

View File

@@ -148,7 +148,6 @@ Kirigami.Page {
property bool filterTextJustChanged: false
sourceModel: root.roomTreeModel
roomSortOrder: SortFilterRoomTreeModel.Categories
activeSpaceId: spaceDrawer.selectedSpaceId
mode: spaceDrawer.showDirectChats ? SortFilterRoomTreeModel.DirectChats : SortFilterRoomTreeModel.Rooms
}