[vlc-commits] qml: change width if video

Abel Tesfaye git at videolan.org
Tue Jul 30 17:57:04 CEST 2019


vlc | branch: master | Abel Tesfaye <Abeltesfaye45 at gmail.com> | Sat Jun 22 15:30:06 2019 +0300| [f4680b5f0d69905e71f23c8ed085d691bd24a5eb] | committer: Jean-Baptiste Kempf

qml: change width if video

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

 modules/gui/qt/qml/mediacenter/MCVideoDisplay.qml | 4 ++--
 modules/gui/qt/qml/style/VLCStyle.qml             | 2 ++
 modules/gui/qt/qml/utils/GridItem.qml             | 8 +++-----
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/modules/gui/qt/qml/mediacenter/MCVideoDisplay.qml b/modules/gui/qt/qml/mediacenter/MCVideoDisplay.qml
index b82d7077cd..5bf1bcb1dd 100644
--- a/modules/gui/qt/qml/mediacenter/MCVideoDisplay.qml
+++ b/modules/gui/qt/qml/mediacenter/MCVideoDisplay.qml
@@ -115,8 +115,8 @@ Utils.NavigableFocusScope {
 
             focus: true
 
-            cellWidth: VLCStyle.cover_normal + VLCStyle.margin_small
-            cellHeight: VLCStyle.cover_normal + VLCStyle.fontHeight_normal
+            cellWidth: (VLCStyle.video_normal_width) + VLCStyle.margin_large
+            cellHeight: (VLCStyle.video_normal_height) + VLCStyle.margin_xlarge + VLCStyle.margin_normal
 
             onSelectAll: delegateModel.selectAll()
             onSelectionUpdated: delegateModel.updateSelection( keyModifiers, oldIndex, newIndex )
diff --git a/modules/gui/qt/qml/style/VLCStyle.qml b/modules/gui/qt/qml/style/VLCStyle.qml
index 899bc41a09..b947dd26f8 100644
--- a/modules/gui/qt/qml/style/VLCStyle.qml
+++ b/modules/gui/qt/qml/style/VLCStyle.qml
@@ -100,6 +100,8 @@ Item {
     property int heightInput: 22 * scale;
 
     property int selectedBorder: 2
+    property real video_normal_height: 160 * scale;
+    property real video_normal_width: video_normal_height * (16/10);
 
     property int miniPlayerHeight: 60 * scale;
 
diff --git a/modules/gui/qt/qml/utils/GridItem.qml b/modules/gui/qt/qml/utils/GridItem.qml
index f0dafa356e..0563eb081d 100644
--- a/modules/gui/qt/qml/utils/GridItem.qml
+++ b/modules/gui/qt/qml/utils/GridItem.qml
@@ -66,15 +66,13 @@ Rectangle {
 
                 Item {
                     id: picture
-
-                    width: VLCStyle.cover_normal
-                    height: VLCStyle.cover_normal - VLCStyle.margin_small
-                    anchors.horizontalCenter: parent.horizontalCenter
+                width: isVideo ? VLCStyle.video_normal_width : VLCStyle.cover_small
+                height: isVideo ? VLCStyle.video_normal_height : VLCStyle.cover_small
                     property bool highlighted: selected || root.activeFocus
 
                     Rectangle {
                         id: cover_bg
-                        width: VLCStyle.cover_small
+                        width: isVideo? VLCStyle.video_normal_width : VLCStyle.cover_small
                         height: VLCStyle.cover_small
                         Behavior on width  { SmoothedAnimation { velocity: 100 } }
                         Behavior on height { SmoothedAnimation { velocity: 100 } }



More information about the vlc-commits mailing list