From d4274654251a85874371bb1215592f32e4f82caa Mon Sep 17 00:00:00 2001 From: miruka Date: Mon, 19 Aug 2019 18:32:43 -0400 Subject: [PATCH] Don't animate highlight rectangle sliding on click --- TODO.md | 7 ++++--- src/qml/SidePane/DelegateAccount.qml | 10 +++++++++- src/qml/SidePane/DelegateRoom.qml | 10 +++++++++- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/TODO.md b/TODO.md index 98ed6cd7..32c1a238 100644 --- a/TODO.md +++ b/TODO.md @@ -1,11 +1,12 @@ - Refactoring - - Don't show the highlight rectangle sliding when clicking room + - Use HInterfaceBox for EditAccount Profile and Encryption + - Use ItemDelegate + - Make all icon SVG files white/black, since we can now use ColorOverlay - Make the icon blue in EditAccount when hovering and no avatar set - - Use HInterfaceBox for EditAccount Profile and Encryption - HButton - - Control: hovered, visualFocus, enaled + - Control: hovered, visualFocus, enabled - Border and pressed color in theme / checkbox theming - `^property type name$` diff --git a/src/qml/SidePane/DelegateAccount.qml b/src/qml/SidePane/DelegateAccount.qml index 03fada96..4b81fed7 100644 --- a/src/qml/SidePane/DelegateAccount.qml +++ b/src/qml/SidePane/DelegateAccount.qml @@ -51,7 +51,15 @@ HInteractiveRectangle { onTriggered: if (isCurrent) beHighlighted() } - TapHandler { onTapped: accountDelegate.activate() } + TapHandler { + onTapped: { + accountRoomList.highlightRangeMode = ListView.NoHighlightRange + accountRoomList.highlightMoveDuration = 0 + activate() + accountRoomList.highlightRangeMode = ListView.ApplyRange + accountRoomList.highlightMoveDuration = theme.animationDuration + } + } HRowLayout { id: row diff --git a/src/qml/SidePane/DelegateRoom.qml b/src/qml/SidePane/DelegateRoom.qml index 947ee742..7c966f9d 100644 --- a/src/qml/SidePane/DelegateRoom.qml +++ b/src/qml/SidePane/DelegateRoom.qml @@ -45,7 +45,15 @@ HInteractiveRectangle { onTriggered: if (isCurrent) beHighlighted() } - TapHandler { onTapped: activate() } + TapHandler { + onTapped: { + accountRoomList.highlightRangeMode = ListView.NoHighlightRange + accountRoomList.highlightMoveDuration = 0 + activate() + accountRoomList.highlightRangeMode = ListView.ApplyRange + accountRoomList.highlightMoveDuration = theme.animationDuration + } + } HRowLayout { id: rowLayout