diff options
author | zheng_wenlong <wenlong_zheng@nexty-ele.com> | 2019-02-15 17:15:55 +0900 |
---|---|---|
committer | zheng_wenlong <wenlong_zheng@nexty-ele.com> | 2019-02-15 17:15:55 +0900 |
commit | ab18b8cf86d7c73d709126e30d81d9609eec4295 (patch) | |
tree | 7d5897a1b653664983533684935ee14b30c8e665 /app/Dashboard.qml | |
parent | 8c48d09f479f798f8deec4dd36c26729c351df21 (diff) |
add resize connectionsandbox/zheng_wenlong/amm2019
Diffstat (limited to 'app/Dashboard.qml')
-rw-r--r-- | app/Dashboard.qml | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/app/Dashboard.qml b/app/Dashboard.qml index d343d8a..f33d074 100644 --- a/app/Dashboard.qml +++ b/app/Dashboard.qml @@ -24,8 +24,8 @@ import Translator 1.0 ApplicationWindow { id: root - width: container.width * container.scale - height: container.height * container.scale + width: screenInfo.width() + height: screenInfo.height() Translator { id: translator @@ -96,9 +96,19 @@ ApplicationWindow { id: container anchors.centerIn: parent width: 1080 - height: 1487 + height: 1488 scale: screenInfo.scale_factor() + Connections { + target: screenInfo + onSizeChanged: { + console.log("The application size changed !") + var w_scale = screenInfo.width() / container.width + var h_scale = screenInfo.height() / container.height + container.scale = w_scale < h_scale ? w_scale : h_scale + } + } + Label { id: speed anchors.left: parent.left @@ -305,6 +315,8 @@ ApplicationWindow { text: qsTr(model.language) onClicked: { translator.language = model.code + console.log ("width = " + screenInfo.width()) + console.log ("height = " + screenInfo.height()) console.log ("Scale = " + screenInfo.scale_factor()) } } |