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