Fix room at index 0 not highlightable
This commit is contained in:
parent
89ee4c2361
commit
8d594e3e83
1
TODO.md
1
TODO.md
|
@ -2,7 +2,6 @@
|
|||
|
||||
## Before release
|
||||
|
||||
- Fix highlighted account/room in MainPane
|
||||
- nio ClientTimeout
|
||||
- Default theme?
|
||||
- Name
|
||||
|
|
|
@ -61,14 +61,22 @@ Column {
|
|||
highlight: null // managed by the AccountRoomsList
|
||||
|
||||
|
||||
readonly property bool hasActiveRoom:
|
||||
window.uiState.page === "Pages/Chat/Chat.qml" &&
|
||||
window.uiState.pageProperties.userId === userId
|
||||
|
||||
readonly property var activeRoomIndex:
|
||||
hasActiveRoom ?
|
||||
model.findIndex(window.uiState.pageProperties.roomId) : null
|
||||
|
||||
|
||||
Binding on currentIndex {
|
||||
value:
|
||||
window.uiState.page === "Pages/Chat/Chat.qml" &&
|
||||
window.uiState.pageProperties.userId === userId ?
|
||||
|
||||
roomList.model.findIndex(window.uiState.pageProperties.roomId)
|
||||
|| -1 :
|
||||
-1
|
||||
roomList.hasActiveRoom ?
|
||||
(
|
||||
roomList.activeRoomIndex === null ?
|
||||
-1 : roomList.activeRoomIndex
|
||||
) : -1
|
||||
|
||||
when: ! view.detachedCurrentIndex
|
||||
}
|
||||
|
|
|
@ -59,6 +59,15 @@ HListView {
|
|||
readonly property Room selectedRoom:
|
||||
currentItem ? currentItem.roomList.currentItem : null
|
||||
|
||||
readonly property bool hasActiveAccount:
|
||||
window.uiState.page === "Pages/Chat/Chat.qml" ||
|
||||
window.uiState.page === "Pages/AddChat/AddChat.qml" ||
|
||||
window.uiState.page === "Pages/AccountSettings/AccountSettings.qml"
|
||||
|
||||
readonly property var activeAccountIndex:
|
||||
hasActiveAccount ?
|
||||
model.findIndex(window.uiState.pageProperties.userId) : null
|
||||
|
||||
|
||||
function previous() {
|
||||
detachedCurrentIndex = true
|
||||
|
@ -198,14 +207,8 @@ HListView {
|
|||
|
||||
Binding on currentIndex {
|
||||
value:
|
||||
[
|
||||
"Pages/Chat/Chat.qml",
|
||||
"Pages/AddChat/AddChat.qml",
|
||||
"Pages/AccountSettings/AccountSettings.qml",
|
||||
].includes(window.uiState.page) ?
|
||||
|
||||
model.findIndex(window.uiState.pageProperties.userId) || -1 :
|
||||
-1
|
||||
hasActiveAccount ?
|
||||
(activeAccountIndex === null ? -1 : activeAccountIndex) : -1
|
||||
|
||||
when: ! detachedCurrentIndex
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user