gui: fix buttons not responding on first click
Replace full-pane MouseArea sloppy focus with HoverHandler which does not interfere with click event delivery. Also increase timer to 300ms and guard against redundant forceActiveFocus() calls.
This commit is contained in:
parent
7703d06430
commit
513029005e
|
|
@ -490,25 +490,25 @@ Item {
|
|||
|
||||
|
||||
|
||||
// Sloppy focus — focus when mouse stops moving inside pane
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
acceptedButtons: Qt.NoButton
|
||||
propagateComposedEvents: true
|
||||
onPositionChanged: {
|
||||
sloppyTimer.restart()
|
||||
}
|
||||
onExited: {
|
||||
sloppyTimer.stop()
|
||||
// Sloppy focus — focus prompt when mouse hovers inside pane
|
||||
HoverHandler {
|
||||
id: sloppyHover
|
||||
onHoveredChanged: {
|
||||
if (hovered) {
|
||||
sloppyTimer.restart()
|
||||
} else {
|
||||
sloppyTimer.stop()
|
||||
}
|
||||
}
|
||||
}
|
||||
Timer {
|
||||
id: sloppyTimer
|
||||
interval: 100
|
||||
interval: 300
|
||||
onTriggered: {
|
||||
paneRoot.focus = true
|
||||
panePrompt.forceActiveFocus()
|
||||
if (!panePrompt.activeFocus) {
|
||||
paneRoot.focus = true
|
||||
panePrompt.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in New Issue