[vlc-commits] [Git][videolan/vlc][master] qml/VideoDisplayRecentVideos: Fix positioning and margins

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Mon Nov 28 09:33:00 UTC 2022



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


Commits:
96caf7e8 by Benjamin Arnaud at 2022-11-28T09:14:28+00:00
qml/VideoDisplayRecentVideos: Fix positioning and margins

- - - - -


2 changed files:

- modules/gui/qt/medialibrary/qml/VideoAllSubDisplay.qml
- modules/gui/qt/medialibrary/qml/VideoDisplayRecentVideos.qml


Changes:

=====================================
modules/gui/qt/medialibrary/qml/VideoAllSubDisplay.qml
=====================================
@@ -220,16 +220,19 @@ VideoAll {
     }
 
     header: VideoDisplayRecentVideos {
-        width: root.width
+        width: root.width - displayMarginBeginning - displayMarginEnd
 
-        subtitleText: (root.model && root.model.count > 0) ? I18n.qtr("Videos") : ""
-
-        // NOTE: We want grid items to be visible on the sides.
-        leftPadding: root.contentMargin
+        x: displayMarginBeginning
 
         // spacing between header and content
         bottomPadding: VLCStyle.margin_normal
 
+        subtitleText: (root.model && root.model.count > 0) ? I18n.qtr("Videos") : ""
+
+        // NOTE: We want grid items to be visible on the sides.
+        displayMarginBeginning: root.contentMargin
+        displayMarginEnd: displayMarginBeginning
+
         Navigation.parentItem: root
 
         Navigation.downAction: function() {


=====================================
modules/gui/qt/medialibrary/qml/VideoDisplayRecentVideos.qml
=====================================
@@ -30,11 +30,13 @@ import "qrc:///style/"
 FocusScope {
     id: root
 
-    property alias leftPadding: recentVideosColumn.leftPadding
-    property alias rightPadding: recentVideosColumn.rightPadding
-    property alias topPadding: recentVideosColumn.topPadding
+    // Aliases
+
     property alias bottomPadding: recentVideosColumn.bottomPadding
 
+    property alias displayMarginBeginning: listView.displayMarginBeginning
+    property alias displayMarginEnd: listView.displayMarginEnd
+
     property alias subtitleText : subtitleLabel.text
 
     // Settings
@@ -70,13 +72,15 @@ FocusScope {
         Widgets.SubtitleLabel {
             text: I18n.qtr("Continue Watching")
 
+            // NOTE: Setting this to listView.visible seems to causes unnecessary implicitHeight
+            //       calculations in the Column parent.
             visible: listView.count > 0
         }
 
         Widgets.KeyNavigableListView {
             id: listView
 
-            width: root.width - root.leftPadding - root.rightPadding
+            width: parent.width
 
             implicitHeight: VLCStyle.gridItem_video_height + VLCStyle.gridItemSelectedBorder
                             +
@@ -84,10 +88,6 @@ FocusScope {
 
             spacing: VLCStyle.column_margin_width
 
-            // NOTE: Sometimes, we want items to be visible on the sides.
-            displayMarginBeginning: root.leftPadding
-            displayMarginEnd: root.rightPadding
-
             // NOTE: We want navigation buttons to be centered on the item cover.
             buttonMargin: VLCStyle.margin_xsmall + VLCStyle.gridCover_video_height / 2 - buttonLeft.height / 2
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/96caf7e8f2b8707cd52c375dd7b768edc8b159c8

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/96caf7e8f2b8707cd52c375dd7b768edc8b159c8
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