[vlc-devel] [PATCH 07/38] qml: provide application size in VLCStyle
Fatih Uzunoglu
fuzun54 at outlook.com
Thu Aug 20 19:55:16 CEST 2020
From: Pierre Lamot <pierre at videolabs.io>
Signed-off-by: Fatih Uzunoglu <fuzun54 at outlook.com>
---
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 50aab35b5e..49bc56a5fd 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
--
2.25.1
More information about the vlc-devel
mailing list