Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
256bd436 by Fatih Uzunoglu at 2026-01-10T15:36:43+01:00
qml: do not respect `pos` if invisible in pointing tool tip

The position of the pointing tool tip is often set to
something that changes very rapidly, such as tracking
the cursor or slider bar handle in motion.

We can use a proxy variable, and break the binding on
`aboutToHide()` signal and re-establish it on
`aboutToShow()` signal. Note that we can not simply use
`visible`, because it may be too late.

- - - - -


1 changed file:

- modules/gui/qt/widgets/qml/PointingTooltip.qml


Changes:

=====================================
modules/gui/qt/widgets/qml/PointingTooltip.qml
=====================================
@@ -32,10 +32,20 @@ ToolTipExt {
     implicitHeight: (implicitContentHeight + topPadding + bottomPadding)
 
     x: _x
-    y: pos.y - (implicitHeight + arrowArea.implicitHeight + VLCStyle.dp(7.5))
+    y: _pos.y - (implicitHeight + arrowArea.implicitHeight + VLCStyle.dp(7.5))
 
-    readonly property real _x: pos.x - (width / 2)
+    readonly property real _x: _pos.x - (width / 2)
     property point pos
+    property point _pos
+
+    // We do not want to respect `pos` until it becomes relevant:
+    onAboutToShow: {
+        _pos = Qt.binding(() => { return pointingTooltip.pos })
+    }
+
+    onAboutToHide: {
+        _pos = pos
+    }
 
     background: Rectangle {
         border.color: pointingTooltip.colorContext.border



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/256bd43656ecd03db4110d2b3892804100d34f07

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/256bd43656ecd03db4110d2b3892804100d34f07
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to