[vlc-commits] [Git][videolan/vlc][master] 5 commits: qml: set flick direction in KeyNavigableListView

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Aug 3 16:36:47 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
7c2fa4da by Fatih Uzunoglu at 2023-08-03T16:13:18+00:00
qml: set flick direction in KeyNavigableListView

- - - - -
8a8a0148 by Fatih Uzunoglu at 2023-08-03T16:13:18+00:00
qml: remove unnecessary scroll bar sizing properties

Scroll bar is not customized, there is no need for
such properties.

- - - - -
300c7cda by Fatih Uzunoglu at 2023-08-03T16:13:18+00:00
qml: do not refer to the vertical scroll bar directly in KeyNavigableListView

- - - - -
d2db73bb by Fatih Uzunoglu at 2023-08-03T16:13:18+00:00
qml: set contentWidth in PlaylistListView

- - - - -
ee5a7734 by Fatih Uzunoglu at 2023-08-03T16:13:18+00:00
qml: use contentWidth as PlaylistListView delegate width

- - - - -


4 changed files:

- modules/gui/qt/playlist/qml/PlaylistListView.qml
- modules/gui/qt/style/VLCStyle.qml
- modules/gui/qt/widgets/qml/KeyNavigableListView.qml
- modules/gui/qt/widgets/qml/KeyNavigableTableView.qml


Changes:

=====================================
modules/gui/qt/playlist/qml/PlaylistListView.qml
=====================================
@@ -213,7 +213,7 @@ T.Pane {
             Layout.topMargin: VLCStyle.margin_normal
             Layout.bottomMargin: VLCStyle.margin_xxsmall
             Layout.leftMargin: VLCStyle.margin_normal
-            Layout.rightMargin: Math.max(listView.scrollBarWidth, VLCStyle.margin_normal)
+            Layout.rightMargin: Math.max(listView.ScrollBar.vertical.width, VLCStyle.margin_normal)
 
             spacing: VLCStyle.margin_large
 
@@ -292,6 +292,8 @@ T.Pane {
             backgroundColor: root.background.usingAcrylic ? "transparent"
                                                           : listView.colorContext.bg.primary
 
+            contentWidth: width
+
             property int shiftIndex: -1
             property Item itemContainsDrag: null
 
@@ -423,7 +425,7 @@ T.Pane {
             delegate: PlaylistDelegate {
                 id: delegate
 
-                width: listView.width
+                width: listView.contentWidth
                 rightPadding: Math.max(listView.ScrollBar.vertical.width, VLCStyle.margin_normal)
 
                 contextMenu: root.contextMenu


=====================================
modules/gui/qt/style/VLCStyle.qml
=====================================
@@ -145,9 +145,6 @@ QtObject {
     readonly property int widthExtendedSpacer: dp(128, scale);
     readonly property int heightInput: dp(22, scale);
 
-    readonly property int scrollbarWidth: dp(4, scale);
-    readonly property int scrollbarHeight: dp(100, scale);
-
     readonly property real network_normal: dp(100, scale)
 
     readonly property int expandAlbumTracksHeight: dp(200, scale)


=====================================
modules/gui/qt/widgets/qml/KeyNavigableListView.qml
=====================================
@@ -36,8 +36,6 @@ FadingEdgeListView {
     // NOTE: We want buttons to be centered vertically but configurable.
     property int buttonMargin: height / 2 - buttonLeft.height / 2
 
-    readonly property int scrollBarWidth: scroll_id.visible ? scroll_id.width : 0
-
     property bool keyNavigationWraps: false
 
     // NOTE: Fading is disabled by default, 'enableBeginningFade' and 'enableEndFade' take
@@ -51,7 +49,6 @@ FadingEdgeListView {
     // Aliases
 
     //forward view properties
-    property alias listScrollBar: scroll_id
 
     property alias buttonLeft: buttonLeft
     property alias buttonRight: buttonRight
@@ -87,9 +84,11 @@ FadingEdgeListView {
     //key navigation is reimplemented for item selection
     keyNavigationEnabled: false
 
-    ScrollBar.vertical: ScrollBar { id: scroll_id }
+    ScrollBar.vertical: ScrollBar { }
     ScrollBar.horizontal: ScrollBar { }
 
+    flickableDirection: Flickable.AutoFlickIfNeeded
+
     highlightMoveDuration: 300 //ms
     highlightMoveVelocity: 1000 //px/s
 


=====================================
modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
=====================================
@@ -125,7 +125,6 @@ FocusScope {
     property alias add:       view.add
     property alias displaced: view.displaced
 
-    property alias listScrollBar: view.listScrollBar
     property alias listView: view
 
     property alias displayMarginEnd: view.displayMarginEnd



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ef763e7b1bb5837825805e8f0af8771f6099ad78...ee5a77348806f3ddeef3ab8480bc446f02e231ac

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