Keep the highlighted ListView item centered
This commit is contained in:
parent
c841a7a841
commit
99bbe7f3ee
2
TODO.md
2
TODO.md
|
@ -1,4 +1,6 @@
|
|||
- Refactoring
|
||||
- Don't show the highlight rectangle sliding when clicking room
|
||||
- Make room loading faster
|
||||
- Filter smart case
|
||||
- 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
|
||||
|
|
|
@ -6,6 +6,16 @@ ListView {
|
|||
currentIndex: -1
|
||||
highlightMoveDuration: theme.animationDuration
|
||||
|
||||
// Keep highlighted delegate at the center
|
||||
highlightRangeMode: ListView.ApplyRange
|
||||
preferredHighlightBegin: height / 2 - currentItemHeight
|
||||
preferredHighlightEnd: height / 2 + currentItemHeight
|
||||
|
||||
|
||||
readonly property int currentItemHeight:
|
||||
currentItem ? currentItem.height : 0
|
||||
|
||||
|
||||
highlight: HRectangle {
|
||||
color: theme.controls.interactiveRectangle.checkedOverlay
|
||||
opacity: theme.controls.interactiveRectangle.checkedOpacity
|
||||
|
|
Loading…
Reference in New Issue
Block a user