[vlc-commits] [Git][videolan/vlc][master] 3 commits: qml/MediaGroupDisplay: Update padding(s) settings

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Dec 5 06:46:55 UTC 2022



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
650a2d7a by Benjamin Arnaud at 2022-12-04T20:05:41+00:00
qml/MediaGroupDisplay: Update padding(s) settings

- - - - -
4f70d5a3 by Benjamin Arnaud at 2022-12-04T20:05:41+00:00
qml/VideoDisplayRecentVideos: Update margins and spacing

- - - - -
b579a542 by Benjamin Arnaud at 2022-12-04T20:05:41+00:00
qml/ExpandGridView: Add 'extraMargin' and 'contentMargin(s)' properties

Co-authored-by: Pierre Lamot <pierre at videolabs.io>

- - - - -


5 changed files:

- modules/gui/qt/medialibrary/qml/MediaGroupDisplay.qml
- modules/gui/qt/medialibrary/qml/VideoAll.qml
- modules/gui/qt/medialibrary/qml/VideoDisplayRecentVideos.qml
- modules/gui/qt/network/qml/BrowseDeviceView.qml
- modules/gui/qt/widgets/qml/ExpandGridView.qml


Changes:

=====================================
modules/gui/qt/medialibrary/qml/MediaGroupDisplay.qml
=====================================
@@ -54,11 +54,10 @@ VideoAll {
     header: Widgets.SubtitleLabel {
         width: root.width
 
-        topPadding: VLCStyle.margin_normal
-        bottomPadding: VLCStyle.margin_normal
-
         // NOTE: We want this to be properly aligned with the grid items.
-        leftPadding: root.contentMargin + VLCStyle.margin_normal
+        leftPadding: root.contentMargin
+
+        bottomPadding: VLCStyle.margin_normal
 
         text: root.title
     }


=====================================
modules/gui/qt/medialibrary/qml/VideoAll.qml
=====================================
@@ -35,8 +35,7 @@ FocusScope {
 
     // Properties
 
-    readonly property int contentMargin: (_currentView.contentMargin) ? _currentView.contentMargin
-                                                                      : 0
+    readonly property int contentMargin: (_currentView) ? _currentView.contentLeftMargin : 0
 
     // NOTE: Specify an optional header for the view.
     property Component header: null
@@ -326,7 +325,7 @@ FocusScope {
         VideoListDisplay {
             id: listView
 
-            readonly property real contentMargin: VLCStyle.margin_normal
+            readonly property real contentLeftMargin: VLCStyle.margin_normal
 
             // Settings
 


=====================================
modules/gui/qt/medialibrary/qml/VideoDisplayRecentVideos.qml
=====================================
@@ -67,7 +67,7 @@ FocusScope {
 
         width: root.width
 
-        spacing: VLCStyle.margin_xsmall
+        spacing: VLCStyle.margin_normal
 
         Widgets.SubtitleLabel {
             text: I18n.qtr("Continue Watching")
@@ -105,16 +105,9 @@ FocusScope {
                 ml: MediaLib
             }
 
-            header: Item {
-                width: VLCStyle.margin_normal
-            }
-
             delegate: VideoGridItem {
                 id: gridItem
 
-                x: selectedBorderWidth
-                y: selectedBorderWidth
-
                 pictureWidth: VLCStyle.gridCover_video_width
                 pictureHeight: VLCStyle.gridCover_video_height
 
@@ -164,10 +157,6 @@ FocusScope {
                 }
             }
 
-            footer: Item {
-                width: VLCStyle.margin_normal
-            }
-
             onActionAtIndex: root._actionAtIndex(index)
         }
 


=====================================
modules/gui/qt/network/qml/BrowseDeviceView.qml
=====================================
@@ -40,7 +40,7 @@ FocusScope {
 
     readonly property int contentHeight: (_currentView) ? _currentView.contentHeight : 0
 
-    readonly property int contentMargin: (_currentView) ? _currentView.contentMargin : 0
+    readonly property int contentMargin: (_currentView) ? _currentView.contentLeftMargin : 0
 
     property int displayMarginEnd: 0
 
@@ -261,7 +261,7 @@ FocusScope {
         Widgets.KeyNavigableTableView {
             id: listView
 
-            readonly property real contentMargin: VLCStyle.margin_normal
+            readonly property real contentLeftMargin: VLCStyle.margin_normal
 
             readonly property int maximumCount: root.maximumRows
 


=====================================
modules/gui/qt/widgets/qml/ExpandGridView.qml
=====================================
@@ -41,10 +41,13 @@ FocusScope {
     property int leftMargin: VLCStyle.margin_normal
     property int rightMargin: VLCStyle.margin_normal
 
-    // NOTE: The grid margin for the item(s) horizontal positioning.
-    readonly property int contentMargin: (_contentWidth - nbItemPerRow * _effectiveCellWidth
-                                          +
-                                          horizontalSpacing) / 2
+    readonly property int extraMargin: (_contentWidth - nbItemPerRow * _effectiveCellWidth
+                                        +
+                                        horizontalSpacing) / 2
+
+    // NOTE: The grid margins for the item(s) horizontal positioning.
+    readonly property int contentLeftMargin: extraMargin + leftMargin
+    readonly property int contentRightMargin: extraMargin + rightMargin
 
     readonly property int rowHeight: cellHeight + verticalSpacing
 
@@ -124,9 +127,8 @@ FocusScope {
 
     onHeightChanged: flickable.layout(false)
 
-    // NOTE: Update on contentMargin change rather than width since the margin defines the x
-    //       position and depends on the width.
-    onContentMarginChanged: flickable.layout(true)
+    // NOTE: Update on contentLeftMargin since we depend on this for item placements.
+    onContentLeftMarginChanged: flickable.layout(true)
 
     onDisplayMarginEndChanged: flickable.layout(false)
 
@@ -341,7 +343,7 @@ FocusScope {
     function getItemPos(id) {
         var rowCol = getItemRowCol(id);
 
-        var x = rowCol[0] * _effectiveCellWidth + contentMargin + leftMargin;
+        var x = rowCol[0] * _effectiveCellWidth + contentLeftMargin;
 
         var y = rowCol[1] * rowHeight + headerHeight + topMargin;
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/30815c4f7c6418373cf967f842ff9003e0d3193e...b579a542de0bbe3ccada1b0d084729fcea31c55e

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