[vlc-commits] [Git][videolan/vlc][master] qml: use mapToItem() instead of mapFromItem()

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat Jul 8 15:48:33 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
a66b4e82 by Fatih Uzunoglu at 2023-07-08T15:27:59+00:00
qml: use mapToItem() instead of mapFromItem()

- - - - -


3 changed files:

- modules/gui/qt/medialibrary/qml/MusicArtistDelegate.qml
- modules/gui/qt/widgets/qml/GridItem.qml
- modules/gui/qt/widgets/qml/TableViewDelegate.qml


Changes:

=====================================
modules/gui/qt/medialibrary/qml/MusicArtistDelegate.qml
=====================================
@@ -104,7 +104,7 @@ T.ItemDelegate {
         }
 
         onPressed: {
-            const pos = drag.target.parent.mapFromItem(root, mouseX, mouseY);
+            const pos = mapToItem(drag.target.parent, mouseX, mouseY);
 
             drag.target.x = pos.x + VLCStyle.dragDelta;
             drag.target.y = pos.y + VLCStyle.dragDelta;


=====================================
modules/gui/qt/widgets/qml/GridItem.qml
=====================================
@@ -209,7 +209,7 @@ T.ItemDelegate {
             if (!drag.target)
                 return
 
-            const pos = drag.target.parent.mapFromItem(root, mouseX, mouseY)
+            const pos = mapToItem(drag.target.parent, mouseX, mouseY)
             drag.target.x = pos.x + VLCStyle.dragDelta
             drag.target.y = pos.y + VLCStyle.dragDelta
         }


=====================================
modules/gui/qt/widgets/qml/TableViewDelegate.qml
=====================================
@@ -135,7 +135,7 @@ T.Control {
                 if (!drag.target)
                     return
 
-                const pos = drag.target.parent.mapFromItem(hoverArea, mouseX, mouseY);
+                const pos = mapToItem(drag.target.parent, mouseX, mouseY);
 
                 drag.target.x = pos.x + VLCStyle.dragDelta;
                 drag.target.y = pos.y + VLCStyle.dragDelta;



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

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


VideoLAN code repository instance


More information about the vlc-commits mailing list