diff --git a/TODO.md b/TODO.md index d0e60bc2..c7cceaf2 100644 --- a/TODO.md +++ b/TODO.md @@ -3,6 +3,7 @@ - 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 diff --git a/src/gui/Base/HFilterModel.qml b/src/gui/Base/HFilterModel.qml index b82febf1..cc81bb0f 100644 --- a/src/gui/Base/HFilterModel.qml +++ b/src/gui/Base/HFilterModel.qml @@ -34,17 +34,17 @@ DelegateModel { for (let i = 0; i < items.count; i++) refilterAt(i) } - function filteredFindIndex(id) { + function filteredFindIndex(id, default_=null) { for (let i = 0; i < filtered.count; i++) if (filtered.get(i).id === id) return i - return null + return default_ } - function filteredFind(id) { + function filteredFind(id, default_=null) { for (let i = 0; i < filtered.count; i++) if (filtered.get(i).id === id) return get(i) - return null + return default_ } } diff --git a/src/gui/MainPane/AccountsBar.qml b/src/gui/MainPane/AccountsBar.qml index 59db58a7..bbf5c0b7 100644 --- a/src/gui/MainPane/AccountsBar.qml +++ b/src/gui/MainPane/AccountsBar.qml @@ -32,7 +32,7 @@ HColumnLayout { currentIndex: roomList.currentIndex === -1 ? -1 : - model.findIndex( + model.filteredFindIndex( roomList.model.filtered.get( roomList.currentIndex, ).model.for_account,