Add an unified room list view
This is off by default and can be enabled in the setting
This commit is contained in:
@@ -52,10 +52,10 @@ Kirigami.ScrollablePage {
|
||||
model: SortFilterRoomListModel {
|
||||
id: sortFilterRoomListModel
|
||||
sourceModel: roomListModel
|
||||
roomSortOrder: SortFilterRoomListModel.Categories
|
||||
roomSortOrder: Config.mergeRoomList ? SortFilterRoomListModel.LastActivity : SortFilterRoomListModel.Categories
|
||||
}
|
||||
|
||||
section.property: sortFilterRoomListModel.filterText.length === 0 ? "category" : null
|
||||
section.property: sortFilterRoomListModel.filterText.length === 0 && !Config.mergeRoomList ? "category" : null
|
||||
section.delegate: Kirigami.ListSectionHeader {
|
||||
id: sectionHeader
|
||||
action: Kirigami.Action {
|
||||
@@ -80,8 +80,9 @@ Kirigami.ScrollablePage {
|
||||
}
|
||||
|
||||
delegate: Kirigami.SwipeListItem {
|
||||
visible: model.categoryVisible || sortFilterRoomListModel.filterText.length > 0
|
||||
height: model.categoryVisible || sortFilterRoomListModel.filterText.length > 0 ? implicitHeight : 0
|
||||
property bool itemVisible: model.categoryVisible || sortFilterRoomListModel.filterText.length > 0 || Config.mergeRoomList
|
||||
visible: itemVisible
|
||||
height: itemVisible ? implicitHeight : 0
|
||||
focus: true
|
||||
action: Kirigami.Action {
|
||||
id: enterRoomAction
|
||||
|
||||
@@ -20,18 +20,20 @@ Kirigami.ScrollablePage {
|
||||
id: showNotifications
|
||||
Kirigami.FormData.label: i18n("Show Notifications:")
|
||||
checked: Config.showNotifications
|
||||
onToggled: Config.showNotifications = checked
|
||||
}
|
||||
}
|
||||
|
||||
footer: RowLayout {
|
||||
QQC2.Button {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
Layout.margins: Kirigami.Units.smallSpacing
|
||||
text: i18n("Save")
|
||||
onClicked: {
|
||||
Config.showNotifications = showNotifications.checked;
|
||||
Config.save();
|
||||
}
|
||||
QQC2.RadioButton {
|
||||
id: mergeRoomList
|
||||
Kirigami.FormData.label: i18n("Rooms and private chats:")
|
||||
text: i18n("Separated")
|
||||
checked: Config.mergeRoomList
|
||||
onToggled: Config.mergeRoomList = true
|
||||
}
|
||||
QQC2.RadioButton {
|
||||
id: mergeRoomList
|
||||
text: i18n("Intermixed")
|
||||
checked: !Config.mergeRoomList
|
||||
onToggled: Config.mergeRoomList = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user