vlc | branch: master | Prince Gupta <guptaprince8...@gmail.com> | Sun Aug 23 
23:11:03 2020 +0530| [21fc590caaaa9d920e44507bb4d2bf62fbee9531] | committer: 
Pierre Lamot

qml: make artist list horizontally resizable

Signed-off-by: Pierre Lamot <pie...@videolabs.io>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=21fc590caaaa9d920e44507bb4d2bf62fbee9531
---

 .../gui/qt/medialibrary/qml/MusicArtistsAlbums.qml | 30 ++++++++++++++++++----
 1 file changed, 25 insertions(+), 5 deletions(-)

diff --git a/modules/gui/qt/medialibrary/qml/MusicArtistsAlbums.qml 
b/modules/gui/qt/medialibrary/qml/MusicArtistsAlbums.qml
index 6c4e4c9038..1215bc4c22 100644
--- a/modules/gui/qt/medialibrary/qml/MusicArtistsAlbums.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicArtistsAlbums.qml
@@ -86,8 +86,8 @@ Widgets.NavigableFocusScope {
         anchors.fill: parent
 
     Rectangle {
-        width: parent.width * 0.25
-        height: parent.height
+        width: artistList.width
+        height: artistList.height
         color: VLCStyle.colors.bgAlt
         opacity: .8
     }
@@ -98,9 +98,10 @@ Widgets.NavigableFocusScope {
         Widgets.KeyNavigableListView {
             id: artistList
 
-            width: parent.width * 0.25
+            width: resizeHandle.clamp(root.width / resizeHandle.widthFactor,
+                                      VLCStyle.colWidth(1) + 
VLCStyle.column_margin_width,
+                                      root.width * .5)
             height: parent.height
-
             spacing: 4
             model: artistModel
             currentIndex: -1
@@ -182,13 +183,32 @@ Widgets.NavigableFocusScope {
                 }
             }
 
+            Behavior on width {
+                SmoothedAnimation {
+                    easing.type: Easing.InSine
+                    duration: 10
+                }
+            }
+
+            Widgets.HorizontalResizeHandle {
+                id: resizeHandle
+
+                anchors {
+                    top: parent.top
+                    bottom: parent.bottom
+                    right: parent.right
+                }
+                sourceWidth: root.width
+                targetWidth: artistList.width
+            }
+
         }
 
         MusicArtist {
             id: albumSubView
 
             height: parent.height
-            width: parent.width * .75
+            width: root.width - artistList.width
             focus: true
             parentId: root.artistId
             initialIndex: root.initialAlbumIndex

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to