From 05325d21bdb52d1143bf026d265e0cf3c0b8553e Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 10 May 2020 17:41:12 -0400 Subject: [PATCH] Fix current account highlighting --- TODO.md | 3 +-- src/gui/MainPane/AccountsBar.qml | 9 +++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/TODO.md b/TODO.md index 4087aaf3..89336203 100644 --- a/TODO.md +++ b/TODO.md @@ -3,14 +3,13 @@ - add account number binds - rename goto*account → scrollto*account -- fix up/down type error when filtering - fix opacity -- fix python error - fix back/front buttons in small window - fix message delegate too tall - fix left rooms opacity - fix escape keybinds (filter rooms, message selection) - fix python getting stuck when loading large room +- fix room out of bounds (above section) when filtering and only one match - account delegates refactor - lag when switching accounts diff --git a/src/gui/MainPane/AccountsBar.qml b/src/gui/MainPane/AccountsBar.qml index 38a35475..8326968f 100644 --- a/src/gui/MainPane/AccountsBar.qml +++ b/src/gui/MainPane/AccountsBar.qml @@ -30,13 +30,10 @@ HColumnLayout { id: accountList clip: true currentIndex: - roomList.currentIndex === -1 ? + roomList.count === 0 || roomList.currentIndex === -1 ? -1 : - model.filteredFindIndex( - roomList.model.filtered.get( - roomList.currentIndex, - ).model.for_account, - -1, + model.findIndex( + roomList.model.get(roomList.currentIndex).for_account, -1, ) model: ModelStore.get("matching_accounts")