[vlc-commits] [Git][videolan/vlc][master] 3 commits: qml: calculate height properly in PointingTooltip

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Nov 18 16:14:46 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
554ab5d4 by Fatih Uzunoglu at 2024-11-18T15:51:44+00:00
qml: calculate height properly in PointingTooltip

Height should take the arrow area into consideration.

- - - - -
d17f5380 by Fatih Uzunoglu at 2024-11-18T15:51:44+00:00
qml: do not offset the arrow in PointingTooltip when not necessary

Offsetting necessary when the popup is in a separate window, and
can cause issues if tool tip have fade animations.

- - - - -
a374c46d by Fatih Uzunoglu at 2024-11-18T15:51:44+00:00
qml: use window popup for ToolTipExt with Qt 6.8

- - - - -


2 changed files:

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


Changes:

=====================================
modules/gui/qt/widgets/qml/PointingTooltip.qml
=====================================
@@ -26,6 +26,9 @@ ToolTipExt {
     margins: 0
     padding: VLCStyle.margin_xxsmall
 
+    height: implicitHeight + background.arrowHeight
+    bottomInset: height - implicitHeight
+
     x: _x
     y: pos.y - (implicitHeight + arrowArea.implicitHeight + VLCStyle.dp(7.5))
 
@@ -37,6 +40,8 @@ ToolTipExt {
         color: pointingTooltip.colorContext.bg.primary
         radius: VLCStyle.dp(6, VLCStyle.scale)
 
+        readonly property real arrowHeight: arrow.implicitHeight + border.width
+
         Item {
             id: arrowArea
 
@@ -54,7 +59,8 @@ ToolTipExt {
                 id: arrow
 
                 anchors.horizontalCenter: parent.horizontalCenter
-                anchors.horizontalCenterOffset: _x - pointingTooltip.x
+                anchors.horizontalCenterOffset: (pointingTooltip.popupType === 1 /* Popup.Window */) ? 0
+                                                                                                     : (pointingTooltip._x - pointingTooltip.x)
                 anchors.verticalCenter: parent.top
 
                 implicitWidth: VLCStyle.dp(10, VLCStyle.scale)


=====================================
modules/gui/qt/widgets/qml/ToolTipExt.qml
=====================================
@@ -39,6 +39,11 @@ T.ToolTip {
 
     closePolicy: T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutsideParent | T.Popup.CloseOnReleaseOutsideParent
 
+    Component.onCompleted: {
+        if (typeof control.popupType === "number")
+            control.popupType = 1 // Popup.Window
+    }
+
     readonly property ColorContext colorContext: ColorContext {
         id: theme
         colorSet: ColorContext.Tooltip



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d689072f0de51a933ba3a1de248cabcb4b19d207...a374c46d0b85b87f0338beb2591c318cef085691

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d689072f0de51a933ba3a1de248cabcb4b19d207...a374c46d0b85b87f0338beb2591c318cef085691
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