From acba085531c4d1ae2e3cf74a758a21a50dce5b69 Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Mon, 3 Nov 2025 13:09:01 -0500 Subject: [PATCH] NSlider: Fix and edge case where the slider would sometime loose focus while dragging. --- Widgets/NSlider.qml | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/Widgets/NSlider.qml b/Widgets/NSlider.qml index c2570386..994ced73 100644 --- a/Widgets/NSlider.qml +++ b/Widgets/NSlider.qml @@ -134,9 +134,8 @@ Slider { anchors.fill: parent cursorShape: Qt.PointingHandCursor hoverEnabled: true - // Pass through mouse events to the slider + acceptedButtons: Qt.NoButton // Don't accept any mouse buttons - only hover propagateComposedEvents: true - preventStealing: false onEntered: { root.hovering = true @@ -151,23 +150,15 @@ Slider { TooltipService.hide() } } + } - onPressed: function (mouse) { - if (root.tooltipText) { + // Hide tooltip when slider is pressed (anywhere on the slider) + Connections { + target: root + function onPressedChanged() { + if (root.pressed && root.tooltipText) { TooltipService.hide() } - // Pass the event through to the slider - mouse.accepted = false - } - - onReleased: function (mouse) { - // Pass the event through to the slider - mouse.accepted = false - } - - onPositionChanged: function (mouse) { - // Pass the event through to the slider - mouse.accepted = false } } }