[vlc-devel] [PATCH 15/15] qml: fix scaling in PointingTooltip

Fatih Uzunoglu fuzun54 at outlook.com
Thu Feb 11 21:23:43 UTC 2021


---
 modules/gui/qt/widgets/qml/PointingTooltip.qml | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/modules/gui/qt/widgets/qml/PointingTooltip.qml b/modules/gui/qt/widgets/qml/PointingTooltip.qml
index 8907175f88..0042826cb7 100644
--- a/modules/gui/qt/widgets/qml/PointingTooltip.qml
+++ b/modules/gui/qt/widgets/qml/PointingTooltip.qml
@@ -27,7 +27,7 @@ Item {
     // set parentWindow if you want to let tooltip not exceed window boundaries
     // if it is not set, tooltip will use mouseArea as the bounding rect.
     // Note that for now it only works with x axis.
-    property var parentWindow: undefined
+    property var parentWindow: g_root
 
     property var mouseArea: undefined
 
@@ -48,7 +48,6 @@ Item {
     function getX() {
         var x = xPos - (pointingTooltip.width / 2)
         var diff = (x + pointingTooltip.width)
-
         var windowMappedX = !!parentWindow ? parentWindow.mapFromItem(mouseArea, mouseArea.x, mouseArea.y).x : undefined
 
         var sliderRealX = 0
@@ -56,9 +55,9 @@ Item {
         if (!!parentWindow) {
             diff -= parentWindow.width - windowMappedX
             sliderRealX = windowMappedX
-        }
-        else
+        } else {
             diff -= mouseArea.width
+        }
 
         if (x < -sliderRealX) {
             if (!!parentWindow)
@@ -66,12 +65,10 @@ Item {
             else
                 arrow.diff = x
             x = -sliderRealX
-        }
-        else if (diff > 0) {
+        } else if (diff > 0) {
             arrow.diff = diff
             x -= (diff)
-        }
-        else {
+        } else {
             arrow.diff = 0
         }
 
@@ -137,12 +134,14 @@ Item {
             anchors.fill: parent
             text: timeMetrics.text
             color: colors.text
+            font: timeMetrics.font
 
             horizontalAlignment: Text.AlignHCenter
             verticalAlignment: Text.AlignVCenter
 
             TextMetrics {
                 id: timeMetrics
+                font.pixelSize: VLCStyle.fontSize_normal
             }
         }
     }
-- 
2.27.0



More information about the vlc-devel mailing list