Filtering → hide accounts with no matching rooms
This commit is contained in:
parent
4f9e320074
commit
5b2c131fd1
2
TODO.md
2
TODO.md
|
@ -1,6 +1,5 @@
|
|||
# TODO
|
||||
|
||||
- account context menu
|
||||
- add account number binds
|
||||
- rename goto*account → scrollto*account
|
||||
|
||||
|
@ -11,6 +10,7 @@
|
|||
- fix escape keybinds (filter rooms, message selection)
|
||||
- fix nio 429
|
||||
|
||||
- account delegates refactor
|
||||
- lag when switching accounts
|
||||
- update glass theme
|
||||
- improve room highlight
|
||||
|
|
|
@ -29,7 +29,6 @@ HColumnLayout {
|
|||
HListView {
|
||||
id: accountList
|
||||
clip: true
|
||||
model: ModelStore.get("accounts")
|
||||
currentIndex:
|
||||
roomList.currentIndex === -1 ?
|
||||
-1 :
|
||||
|
@ -40,6 +39,63 @@ HColumnLayout {
|
|||
-1,
|
||||
)
|
||||
|
||||
model: HFilterModel {
|
||||
model: ModelStore.get("accounts")
|
||||
acceptItem: item =>
|
||||
! roomFilter || item.id in roomList.sectionIndice
|
||||
|
||||
delegate: HTileDelegate {
|
||||
id: tile
|
||||
width: accountList.width
|
||||
backgroundColor:
|
||||
theme.accountsBar.accountList.account.background
|
||||
|
||||
topPadding: (accountList.width - avatar.width) / 4
|
||||
bottomPadding: topPadding
|
||||
leftPadding: 0
|
||||
rightPadding: leftPadding
|
||||
|
||||
contentItem: Item {
|
||||
implicitHeight: avatar.height
|
||||
|
||||
HUserAvatar {
|
||||
id: avatar
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
userId: model.id
|
||||
displayName: model.display_name
|
||||
mxc: model.avatar_url
|
||||
// compact: tile.compact
|
||||
|
||||
radius:
|
||||
theme.accountsBar.accountList.account.avatarRadius
|
||||
}
|
||||
|
||||
MessageIndicator {
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
indicatorTheme:
|
||||
theme.accountView.account.unreadIndicator
|
||||
unreads: model.total_unread
|
||||
mentions: model.total_mentions
|
||||
}
|
||||
}
|
||||
|
||||
contextMenu: AccountContextMenu { userId: model.id }
|
||||
|
||||
onLeftClicked: {
|
||||
model.id in roomList.sectionIndice ?
|
||||
roomList.goToAccount(model.id) :
|
||||
pageLoader.showPage("AddChat/AddChat", {userId: model.id})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onRoomFilterChanged: refilterAll()
|
||||
|
||||
readonly property string roomFilter: roomList.filter
|
||||
}
|
||||
|
||||
highlight: Item {
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
|
@ -56,49 +112,6 @@ HColumnLayout {
|
|||
}
|
||||
}
|
||||
|
||||
delegate: HTileDelegate {
|
||||
id: tile
|
||||
width: accountList.width
|
||||
backgroundColor: theme.accountsBar.accountList.account.background
|
||||
|
||||
topPadding: (accountList.width - avatar.width) / 4
|
||||
bottomPadding: topPadding
|
||||
leftPadding: 0
|
||||
rightPadding: leftPadding
|
||||
|
||||
contentItem: Item {
|
||||
implicitHeight: avatar.height
|
||||
|
||||
HUserAvatar {
|
||||
id: avatar
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
userId: model.id
|
||||
displayName: model.display_name
|
||||
mxc: model.avatar_url
|
||||
// compact: tile.compact
|
||||
|
||||
radius: theme.accountsBar.accountList.account.avatarRadius
|
||||
}
|
||||
|
||||
MessageIndicator {
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
indicatorTheme: theme.accountView.account.unreadIndicator
|
||||
unreads: model.total_unread
|
||||
mentions: model.total_mentions
|
||||
}
|
||||
}
|
||||
|
||||
contextMenu: AccountContextMenu { userId: model.id }
|
||||
|
||||
onLeftClicked: {
|
||||
model.id in roomList.sectionIndice ?
|
||||
roomList.goToAccount(model.id) :
|
||||
pageLoader.showPage("AddChat/AddChat", {userId: model.id})
|
||||
}
|
||||
}
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user