[vlc-commits] qml: update row height of table view

Prince Gupta git at videolan.org
Thu Dec 17 14:57:04 UTC 2020


vlc | branch: master | Prince Gupta <guptaprince8832 at gmail.com> | Thu Dec  3 18:54:11 2020 +0530| [551d7d0ebc0efbd5b709c91bca57bf0ec47a9633] | committer: Pierre Lamot

qml: update row height of table view

Signed-off-by: Pierre Lamot <pierre at videolabs.io>

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

 modules/gui/qt/medialibrary/qml/MusicAlbums.qml                   | 1 +
 modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml | 1 +
 modules/gui/qt/medialibrary/qml/MusicArtist.qml                   | 1 +
 modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml           | 1 +
 modules/gui/qt/medialibrary/qml/MusicGenres.qml                   | 1 +
 modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml         | 1 +
 modules/gui/qt/medialibrary/qml/VideoListDisplay.qml              | 2 +-
 modules/gui/qt/network/qml/NetworkBrowseDisplay.qml               | 2 +-
 modules/gui/qt/style/VLCStyle.qml                                 | 3 +++
 modules/gui/qt/widgets/qml/KeyNavigableTableView.qml              | 2 +-
 10 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt/medialibrary/qml/MusicAlbums.qml b/modules/gui/qt/medialibrary/qml/MusicAlbums.qml
index 256be1a6fb..2ca93cf51e 100644
--- a/modules/gui/qt/medialibrary/qml/MusicAlbums.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicAlbums.qml
@@ -210,6 +210,7 @@ Widgets.NavigableFocusScope {
             section.property: "title_first_symbol"
             header: root.header
             dragItem: albumDragItem
+            rowHeight: VLCStyle.tableCoverRow_height
 
             sortModel:  [
                 { isPrimary: true, criteria: "title", width: VLCStyle.colWidth(2), text: i18n.qtr("Title"), headerDelegate: tableColumns.titleHeaderDelegate, colDelegate: tableColumns.titleDelegate },
diff --git a/modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml b/modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
index ed335098cb..84b01696e4 100644
--- a/modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
@@ -195,6 +195,7 @@ Widgets.NavigableFocusScope {
                 Layout.fillHeight: true
                 Layout.topMargin: VLCStyle.margin_normal
 
+                rowHeight: VLCStyle.tableRow_height
                 headerColor: VLCStyle.colors.bgAlt
 
                 parentId : root.model.id
diff --git a/modules/gui/qt/medialibrary/qml/MusicArtist.qml b/modules/gui/qt/medialibrary/qml/MusicArtist.qml
index cc09ce652c..0aab2c12fc 100644
--- a/modules/gui/qt/medialibrary/qml/MusicArtist.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicArtist.qml
@@ -348,6 +348,7 @@ Widgets.NavigableFocusScope {
             navigationParent: root
             header: root.header
             headerPositioning: ListView.InlineHeader
+            rowHeight: VLCStyle.tableCoverRow_height
 
             sortModel:  [
                 { isPrimary: true, criteria: "title", width: VLCStyle.colWidth(2), text: i18n.qtr("Title"), headerDelegate: tableColumns.titleHeaderDelegate, colDelegate: tableColumns.titleDelegate },
diff --git a/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml b/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml
index 1e5d3797cd..0048c09281 100644
--- a/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml
@@ -204,6 +204,7 @@ Widgets.PageLoader {
                     headerColor: VLCStyle.colors.bg
                     navigationParent: root
                     dragItem: artistsDragItem
+                    rowHeight: VLCStyle.tableCoverRow_height
 
                     onActionForSelection: {
                         if (selection.length > 1) {
diff --git a/modules/gui/qt/medialibrary/qml/MusicGenres.qml b/modules/gui/qt/medialibrary/qml/MusicGenres.qml
index 17c240733d..0ade8728a2 100644
--- a/modules/gui/qt/medialibrary/qml/MusicGenres.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicGenres.qml
@@ -262,6 +262,7 @@ Widgets.NavigableFocusScope {
             onActionForSelection: _actionAtIndex(selection)
             navigationParent: root
             dragItem: genreDragItem
+            rowHeight: VLCStyle.tableCoverRow_height
 
             sortModel:  [
                 { isPrimary: true, criteria: "cover", width: VLCStyle.listAlbumCover_width, headerDelegate: thumbnailHeader, colDelegate: thumbnailColumn },
diff --git a/modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml b/modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml
index d50c04a236..fb5c595a84 100644
--- a/modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml
@@ -62,6 +62,7 @@ MainInterface.MainTableView {
 
     model: rootmodel
     selectionDelegateModel: selectionModel
+    rowHeight: VLCStyle.tableCoverRow_height
 
     property alias parentId: rootmodel.parentId
 
diff --git a/modules/gui/qt/medialibrary/qml/VideoListDisplay.qml b/modules/gui/qt/medialibrary/qml/VideoListDisplay.qml
index 0aa2772172..93a3540aa0 100644
--- a/modules/gui/qt/medialibrary/qml/VideoListDisplay.qml
+++ b/modules/gui/qt/medialibrary/qml/VideoListDisplay.qml
@@ -70,7 +70,7 @@ MainInterface.MainTableView {
 
     section.property: "title_first_symbol"
 
-    rowHeight: VLCStyle.listAlbumCover_height + VLCStyle.margin_xxsmall * 2
+    rowHeight: VLCStyle.tableCoverRow_height
 
     headerColor: VLCStyle.colors.bg
 
diff --git a/modules/gui/qt/network/qml/NetworkBrowseDisplay.qml b/modules/gui/qt/network/qml/NetworkBrowseDisplay.qml
index 1e324a7de9..1b56856104 100644
--- a/modules/gui/qt/network/qml/NetworkBrowseDisplay.qml
+++ b/modules/gui/qt/network/qml/NetworkBrowseDisplay.qml
@@ -250,7 +250,7 @@ Widgets.NavigableFocusScope {
                 history.previous()
             }
 
-            rowHeight: VLCStyle.listAlbumCover_height + VLCStyle.margin_xxsmall * 2
+            rowHeight: VLCStyle.tableCoverRow_height
 
             header: Widgets.NavigableFocusScope {
                 width: view.width
diff --git a/modules/gui/qt/style/VLCStyle.qml b/modules/gui/qt/style/VLCStyle.qml
index 52318505eb..f597020f39 100644
--- a/modules/gui/qt/style/VLCStyle.qml
+++ b/modules/gui/qt/style/VLCStyle.qml
@@ -74,6 +74,9 @@ Item {
     property int trackListAlbumCover_width: dp(32, scale)
     property int trackListAlbumCover_heigth: dp(32, scale)
 
+    property int tableCoverRow_height: Math.max(listAlbumCover_height, fontHeight_normal) + margin_xsmall * 2
+    property int tableRow_height: fontHeight_normal + margin_small * 2
+
     property int icon_xsmall: dp(8, scale);
     property int icon_small: dp(16, scale);
     property int icon_normal: dp(32, scale);
diff --git a/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml b/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
index 8efa0cb802..81403f08ea 100644
--- a/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
+++ b/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
@@ -67,7 +67,7 @@ NavigableFocusScope {
     property alias footer: view.footer
 
     property var selectionDelegateModel
-    property real rowHeight: VLCStyle.fontHeight_normal + VLCStyle.margin_large
+    property real rowHeight: VLCStyle.tableRow_height
     readonly property real availableRowWidth: width - ( VLCStyle.table_section_width * 2 )
     property alias spacing: view.spacing
     property int horizontalSpacing: VLCStyle.column_margin_width



More information about the vlc-commits mailing list