[vlc-commits] qml: provide application size in VLCStyle

Pierre Lamot git at videolan.org
Thu Aug 27 12:44:35 CEST 2020


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Thu Aug 13 21:32:26 2020 +0300| [5903dbbf88034688d21b7f36cb9e1b78c0bf48e9] | committer: Pierre Lamot

qml: provide application size in VLCStyle

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

 modules/gui/qt/maininterface/qml/MainInterface.qml | 13 +++++++++++++
 modules/gui/qt/style/VLCStyle.qml                  |  6 ++++++
 2 files changed, 19 insertions(+)

diff --git a/modules/gui/qt/maininterface/qml/MainInterface.qml b/modules/gui/qt/maininterface/qml/MainInterface.qml
index 2344ef91c9..e7ffe949fb 100644
--- a/modules/gui/qt/maininterface/qml/MainInterface.qml
+++ b/modules/gui/qt/maininterface/qml/MainInterface.qml
@@ -36,6 +36,19 @@ Rectangle {
     property bool _interfaceReady: false
     property bool _playlistReady: false
 
+
+    Binding {
+        target: VLCStyle.self
+        property: "appWidth"
+        value: root.width
+    }
+
+    Binding {
+        target: VLCStyle.self
+        property: "appHeight"
+        value: root.height
+    }
+
     Loader {
         id: playlistWindowLoader
         active: !mainInterface.playlistDocked && mainInterface.playlistVisible
diff --git a/modules/gui/qt/style/VLCStyle.qml b/modules/gui/qt/style/VLCStyle.qml
index 325cddae73..bbf6db1b96 100644
--- a/modules/gui/qt/style/VLCStyle.qml
+++ b/modules/gui/qt/style/VLCStyle.qml
@@ -32,6 +32,8 @@ Item {
     TextMetrics { id: fontMetrics_xxlarge;  font.pixelSize: dp(20, scale); text: "lq"}
     TextMetrics { id: fontMetrics_xxxlarge;  font.pixelSize: dp(30, scale); text: "lq"}
 
+    property alias self: vlc_style
+
     property VLCColors colors: VLCColors {}
 
     // Sizes
@@ -172,6 +174,10 @@ Item {
     property int table_cover_border: dp(2, scale)
 
     property int artistBanner_height: dp(200, scale)
+    
+    //global application size, updated by the root widget
+    property int appWidth: 0
+    property int appHeight: 0
 
     //global application margin "safe area"
     property int applicationHorizontalMargin: 0



More information about the vlc-commits mailing list