aboutsummaryrefslogtreecommitdiffstats
path: root/Main.qml
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@pelagicore.com>2016-08-29 13:30:51 +0200
committerDominik Holland <dominik.holland@pelagicore.com>2016-08-30 09:33:24 +0000
commit6e9bc5488361055e0825ffd179431a335ec22a76 (patch)
tree822ead72d9f1fa2279354996e9e6a60ea9bbeaae /Main.qml
parent2f6d87caf307fcad9fa9506eacd948a3fd6d9eb1 (diff)
Automatically detect the screen size of the cluster as well
The aspect ratio is fixed, so we align with the display width Change-Id: Ie65f012925b5215a85c8c61b0c5bcb50390beddf Reviewed-by: Nedim Hadzic <nedim.hadzic@pelagicore.com>
Diffstat (limited to 'Main.qml')
-rw-r--r--Main.qml11
1 files changed, 9 insertions, 2 deletions
diff --git a/Main.qml b/Main.qml
index 1428b7d..bf4fd3a 100644
--- a/Main.qml
+++ b/Main.qml
@@ -83,19 +83,26 @@ Rectangle {
Window {
id: cluster
title: "Neptune Cluster Display"
- height: 720
- width: 1920
+ height: Style.clusterHeight
+ width: Style.clusterWidth
visible: false
color: "black"
Cluster {}
+ function calculateSize() {
+ print (Screen.width, Screen.height)
+ Style.clusterWidth = Screen.width
+ Style.clusterHeight = Screen.width * 0.375
+ }
+
Component.onCompleted: {
WindowManager.registerCompositorView(cluster)
Style.withCluster = true
ScreenManager.setScreen(cluster, 1)
cluster.show()
+ calculateSize()
}
}
}