diff options
author | Grigorii Zimin <gzimin@luxoft.com> | 2020-03-04 12:15:23 +0300 |
---|---|---|
committer | Grigorii Zimin <gzimin@luxoft.com> | 2020-03-04 10:57:35 +0000 |
commit | b73e2e1f13f752f50872220d21e09388e2e71458 (patch) | |
tree | 642265a99effd572c5663dec2a24c5f9deef6fe8 | |
parent | aa928efbcb45a30772953ed00cade7b9b833e798 (diff) |
[cluster-app] update scale behavior
Change-Id: If828a2afe3583acdb2dc36cab6635c15fc08e128
Reviewed-by: Vladimir Minenko <vladimir.minenko@pelagicore.com>
Reviewed-by: Egor Nemtsev <enemtsev@luxoft.com>
-rw-r--r-- | src/neptune-cluster-app/main.qml | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/neptune-cluster-app/main.qml b/src/neptune-cluster-app/main.qml index 5e2c9af2..7f89c5c2 100644 --- a/src/neptune-cluster-app/main.qml +++ b/src/neptune-cluster-app/main.qml @@ -45,12 +45,7 @@ Window { title: qsTr("Cluster") color: "black" - - readonly property real scaleRatio: Math.min(root.width / 1920, root.height / 1080) - onScaleRatioChanged: { - root.Sizes.scale = scaleRatio - } - + readonly property real mockedWindowsAcpectRatio: 1920 / 720 Component.onCompleted: { root.Style.theme = Style.Dark; } @@ -67,10 +62,18 @@ Window { } MockedWindows { - clip: true id: mockedWindows - width: height * (1920 / 720) - height: Sizes.dp(720) + + clip: true + height: Math.floor(root.width / mockedWindowsAcpectRatio) <= root.height + ? root.width / mockedWindowsAcpectRatio + : root.height; + width: height * mockedWindowsAcpectRatio + + onWidthChanged: { + root.Sizes.scale = mockedWindows.width / 1920; + } + anchors.centerIn: parent ClusterView { |