[vlc-devel] [PATCH 33/49] qml: fix hardcoded size in NetworkDisplay home page

Pierre Lamot pierre at videolabs.io
Fri Oct 11 15:17:57 CEST 2019


---
 modules/gui/qt/qml/mediacenter/MCNetworkDisplay.qml | 6 ++++--
 modules/gui/qt/qml/style/VLCStyle.qml               | 9 +++++++++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/qml/mediacenter/MCNetworkDisplay.qml b/modules/gui/qt/qml/mediacenter/MCNetworkDisplay.qml
index 8cfbe5d54b..bc1e9cf629 100644
--- a/modules/gui/qt/qml/mediacenter/MCNetworkDisplay.qml
+++ b/modules/gui/qt/qml/mediacenter/MCNetworkDisplay.qml
@@ -175,6 +175,8 @@ Utils.NavigableFocusScope {
                     width: parent.width
                     height: implicitHeight
 
+                    spacing: VLCStyle.margin_normal
+
                     Utils.LabelSeparator {
                         text: qsTr("Devices")
                         width: flickable.width
@@ -188,7 +190,7 @@ Utils.NavigableFocusScope {
                         visible: machineDM.items.count !== 0
 
                         width: flickable.width
-                        height: 150 //FIXME
+                        height: VLCStyle.gridItem_default_height
                         orientation: ListView.Horizontal
 
                         model: machineDM.parts.grid
@@ -220,7 +222,7 @@ Utils.NavigableFocusScope {
                         focus: false
 
                         width: flickable.width
-                        height: 150 //FIXME
+                        height: VLCStyle.gridItem_default_height
                         orientation: ListView.Horizontal
 
                         model: lanDM.parts.grid
diff --git a/modules/gui/qt/qml/style/VLCStyle.qml b/modules/gui/qt/qml/style/VLCStyle.qml
index aa475840db..c1e1c68c31 100644
--- a/modules/gui/qt/qml/style/VLCStyle.qml
+++ b/modules/gui/qt/qml/style/VLCStyle.qml
@@ -132,6 +132,15 @@ Item {
     property int button_width_normal: 96 * scale
     property int button_width_large: 128 * scale
 
+
+    //GridItem
+    property int gridItem_default_height: VLCStyle.cover_small + VLCStyle.fontHeight_normal + VLCStyle.fontHeight_small + VLCStyle.margin_xxxsmall * 2
+    property int gridItem_default_width: VLCStyle.cover_small + VLCStyle.margin_small * 2
+
+    property int gridItem_video_height: VLCStyle.video_normal_height + VLCStyle.fontHeight_normal + VLCStyle.fontHeight_small * 2  + VLCStyle.margin_xxxsmall * 3
+    property int gridItem_video_width: VLCStyle.video_normal_width + VLCStyle.margin_small * 2
+
+
     //timings
     property int delayToolTipAppear: 500;
     property int timingPlaylistClose: 1000;
-- 
2.20.1



More information about the vlc-devel mailing list