[vlc-devel] [PATCH 05/30] qml: update row height of table view

Prince Gupta guptaprince8832 at gmail.com
Mon Dec 14 14:27:43 CET 2020


---
 modules/gui/qt/medialibrary/qml/MusicAlbums.qml                | 1 +
 .../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 4a39f8ed2a..5dfa325629 100644
--- a/modules/gui/qt/medialibrary/qml/MusicAlbums.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicAlbums.qml
@@ -187,6 +187,7 @@ Widgets.NavigableFocusScope {
             navigationParent: root
             section.property: "title_first_symbol"
             header: root.header
+            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 4573b9bc96..504f4065f3 100644
--- a/modules/gui/qt/medialibrary/qml/MusicArtist.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicArtist.qml
@@ -319,6 +319,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 48ff1b7a03..fb7ccd0083 100644
--- a/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml
@@ -181,6 +181,7 @@ Widgets.PageLoader {
                     focus: true
                     headerColor: VLCStyle.colors.bg
                     navigationParent: root
+                    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 c44c5e8f40..b44caf11da 100644
--- a/modules/gui/qt/medialibrary/qml/MusicGenres.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicGenres.qml
@@ -239,6 +239,7 @@ Widgets.NavigableFocusScope {
             focus: true
             onActionForSelection: _actionAtIndex(selection)
             navigationParent: root
+            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 0ae9be7919..55cf556878 100644
--- a/modules/gui/qt/network/qml/NetworkBrowseDisplay.qml
+++ b/modules/gui/qt/network/qml/NetworkBrowseDisplay.qml
@@ -216,7 +216,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 3a541aa8c0..58ffe5970c 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
-- 
2.25.1



More information about the vlc-devel mailing list