[vlc-devel] [PATCH 18/27] qml: fix HorizontalResizeHandle cursor management

Fatih Uzunoglu fuzun54 at outlook.com
Fri Dec 4 00:01:53 CET 2020


CursorShape of MouseArea which is used in HorizontalResizeHandle is only valid when the mouse location stays inside MouseArea's boundingRect. However, we would like to see the cursor intact even when mouse goes outside during resizing.
---
 modules/gui/qt/widgets/qml/HorizontalResizeHandle.qml | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/widgets/qml/HorizontalResizeHandle.qml b/modules/gui/qt/widgets/qml/HorizontalResizeHandle.qml
index ab0bd0d386..dc7216cdd7 100644
--- a/modules/gui/qt/widgets/qml/HorizontalResizeHandle.qml
+++ b/modules/gui/qt/widgets/qml/HorizontalResizeHandle.qml
@@ -41,7 +41,14 @@ MouseArea {
     width: VLCStyle.dp(8, VLCStyle.scale)
     acceptedButtons: Qt.LeftButton
 
-    onPressed: _previousX = mouseX
+    onPressed: {
+        mainInterface.setCursor(cursorShape)
+        _previousX = mouseX
+    }
+
+    onReleased: {
+        mainInterface.restoreCursor()
+    }
 
     onPositionChanged: {
         var f = atRight ? -1 : 1
-- 
2.27.0



More information about the vlc-devel mailing list