Hide hover highlight when moving with keybinds
This commit is contained in:
parent
073a2eacee
commit
7e7852b51e
|
@ -1,10 +1,12 @@
|
|||
import QtQuick 2.12
|
||||
|
||||
HRectangle {
|
||||
id: rectangle
|
||||
|
||||
property bool checkable: false // TODO
|
||||
property bool checked: false
|
||||
property alias pressed: tap.pressed
|
||||
property alias hovered: hover.hovered
|
||||
property bool hovered: false
|
||||
readonly property alias pressed: tap.pressed
|
||||
|
||||
readonly property QtObject _ir: theme.controls.interactiveRectangle
|
||||
color: _ir.background
|
||||
|
@ -26,6 +28,10 @@ HRectangle {
|
|||
"transparent"
|
||||
}
|
||||
|
||||
HoverHandler { id: hover }
|
||||
HoverHandler {
|
||||
id: hover
|
||||
onHoveredChanged: rectangle.hovered = hovered
|
||||
}
|
||||
|
||||
TapHandler { id: tap }
|
||||
}
|
||||
|
|
|
@ -7,6 +7,10 @@ HListView {
|
|||
id: accountRoomList
|
||||
|
||||
|
||||
signal hideHoverHighlight()
|
||||
onHideHoverHighlight: hoverBlocker.enabled = true
|
||||
|
||||
|
||||
readonly property var originSource: window.sidePaneModelSource
|
||||
readonly property var collapseAccounts: window.uiState.collapseAccounts
|
||||
readonly property string filter: paneToolBar.roomFilter
|
||||
|
@ -58,12 +62,14 @@ HListView {
|
|||
}
|
||||
|
||||
function previous(activate=true) {
|
||||
hideHoverHighlight()
|
||||
decrementCurrentIndex()
|
||||
if (activate) activateLimiter.requestFire()
|
||||
|
||||
}
|
||||
|
||||
function next(activate=true) {
|
||||
hideHoverHighlight()
|
||||
incrementCurrentIndex()
|
||||
if (activate) activateLimiter.requestFire()
|
||||
}
|
||||
|
@ -105,6 +111,17 @@ HListView {
|
|||
}
|
||||
|
||||
|
||||
MouseArea {
|
||||
id: hoverBlocker
|
||||
anchors.fill: parent
|
||||
enabled: false
|
||||
hoverEnabled: enabled
|
||||
propagateComposedEvents: true
|
||||
|
||||
onMouseXChanged: enabled = false
|
||||
onMouseYChanged: enabled = false
|
||||
}
|
||||
|
||||
HRateLimiter {
|
||||
id: filterLimiter
|
||||
cooldown: 16
|
||||
|
|
|
@ -51,6 +51,11 @@ HInteractiveRectangle {
|
|||
onTriggered: if (isCurrent) beHighlighted()
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: accountRoomList
|
||||
onHideHoverHighlight: accountDelegate.hovered = false
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
onTapped: {
|
||||
accountRoomList.highlightRangeMode = ListView.NoHighlightRange
|
||||
|
|
|
@ -45,6 +45,11 @@ HInteractiveRectangle {
|
|||
onTriggered: if (isCurrent) beHighlighted()
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: accountRoomList
|
||||
onHideHoverHighlight: roomDelegate.hovered = false
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
onTapped: {
|
||||
accountRoomList.highlightRangeMode = ListView.NoHighlightRange
|
||||
|
@ -57,8 +62,6 @@ HInteractiveRectangle {
|
|||
|
||||
HRowLayout {
|
||||
id: rowLayout
|
||||
property var pr: sidePane.currentSpacing
|
||||
onPrChanged: print("pr changed:", pr, spacing, x)
|
||||
|
||||
spacing: sidePane.currentSpacing
|
||||
x: sidePane.currentSpacing
|
||||
|
|
Loading…
Reference in New Issue
Block a user