[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml: allow scrolling text on elision in default col delegate of table view

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat Mar 26 11:32:03 UTC 2022



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


Commits:
e2440608 by Prince Gupta at 2022-03-26T11:14:23+00:00
qml: allow scrolling text on elision in default col delegate of table view

- - - - -
10e096a3 by Prince Gupta at 2022-03-26T11:14:23+00:00
qml: allow scrolling text on elision in title col delegate of table view

- - - - -


2 changed files:

- modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
- modules/gui/qt/widgets/qml/TableColumns.qml


Changes:

=====================================
modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
=====================================
@@ -34,13 +34,34 @@ FocusScope {
 
     property var sortModel: []
 
-    property Component colDelegate: Widgets.ListLabel {
+    property Component colDelegate: Widgets.ScrollingText {
+        id: textRect
+
         property var rowModel: parent.rowModel
         property var model: parent.colModel
+        property color foregroundColor: parent.foregroundColor
 
-        anchors.fill: parent
-        text: !rowModel ? "" : (rowModel[model.criteria] || "")
-        color: parent.foregroundColor
+        label: text
+        scroll: hoverArea.containsMouse || parent.currentlyFocused
+        width: parent.width
+        clip: animationRunning
+
+        Widgets.ListLabel {
+            id: text
+
+            anchors.verticalCenter: parent.verticalCenter
+            text: !rowModel ? "" : (rowModel[model.criteria] || "")
+            color: textRect.foregroundColor
+            elide: textRect.scroll ?  Text.ElideNone : Text.ElideRight
+            width: parent.width
+        }
+
+        MouseArea {
+            id: hoverArea
+
+            anchors.fill: parent
+            hoverEnabled: true
+        }
     }
 
     property Component tableHeaderDelegate: Widgets.CaptionLabel {


=====================================
modules/gui/qt/widgets/qml/TableColumns.qml
=====================================
@@ -87,13 +87,33 @@ Item {
             }
         }
 
-        Widgets.ListLabel {
-            text: (!rowModel || !root.showTitleText) ? "" : (rowModel[model.criteria] || I18n.qtr("Unknown Title"))
+        Widgets.ScrollingText {
+            id: textRect
+
+            label: text
+            scroll: textHoverArea.containsMouse || parent.currentlyFocused
+            clip: animationRunning
             visible: root.showTitleText
-            color: foregroundColor
 
             Layout.fillHeight: true
             Layout.fillWidth: true
+
+            Widgets.ListLabel {
+                id: text
+
+                anchors.verticalCenter: parent.verticalCenter
+                text: (!rowModel || !root.showTitleText) ? "" : (rowModel[model.criteria] || I18n.qtr("Unknown Title"))
+                color: foregroundColor
+                elide: textRect.scroll ?  Text.ElideNone : Text.ElideRight
+                width: parent.width
+            }
+
+            MouseArea {
+                id: textHoverArea
+
+                anchors.fill: parent
+                hoverEnabled: true
+            }
         }
     }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8ab9e9eb9e859c0bd9349a763e6025ec3dc4b1e9...10e096a3a5b358a14d5728ff1b19c849912cae00

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8ab9e9eb9e859c0bd9349a763e6025ec3dc4b1e9...10e096a3a5b358a14d5728ff1b19c849912cae00
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