summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2022-08-19 12:41:23 +0200
committerThomas Hartmann <thomas.hartmann@qt.io>2022-08-19 12:05:00 +0000
commitdc8e13995ab43fd1c05ec40ea876f5208869aa38 (patch)
treeadc01c97f3346c6bad68ba1441af4730d852686b
parent00679f2af2b5b68a901cf13a1b29f70a92552d50 (diff)
downloadqt-creator-dc8e13995ab43fd1c05ec40ea876f5208869aa38.tar.gz
StudioWelcome: Scale down splash screen if it does not fit
If the splash screen does not fit on the screen we have to scale it down. Task-number: QDS-7449 Change-Id: I73018563e9f863d3a8f60facf7599590fb602f0f Reviewed-by: Brook Cronin <brook.cronin@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
-rw-r--r--src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml5
-rw-r--r--src/plugins/studiowelcome/qml/splashscreen/main.qml14
2 files changed, 12 insertions, 7 deletions
diff --git a/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml b/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml
index 153436278e..73c4eded2b 100644
--- a/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml
+++ b/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml
@@ -32,7 +32,8 @@ import QtQuick.Shapes 1.0
Rectangle {
id: welcome_splash
- anchors.fill: parent
+ width: 600
+ height: 720
clip: true
gradient: Gradient {
@@ -55,8 +56,6 @@ Rectangle {
property bool doNotShowAgain: true
property bool loadingPlugins: true
- width: 600
- height: 720
visible: true
color: "#1d212a"
diff --git a/src/plugins/studiowelcome/qml/splashscreen/main.qml b/src/plugins/studiowelcome/qml/splashscreen/main.qml
index b60e4668cb..ee68681ab5 100644
--- a/src/plugins/studiowelcome/qml/splashscreen/main.qml
+++ b/src/plugins/studiowelcome/qml/splashscreen/main.qml
@@ -27,8 +27,13 @@ import QtQuick 2.0
Item {
id: root
- width: 600
- height: 720
+ width: 600 * root.mainScale
+ height: 720 * root.mainScale
+
+ property int maxHeight: Screen.desktopAvailableHeight - 100
+
+ property real mainScale: root.maxHeight > 720 ? 1 : root.maxHeight / 720
+
signal closeClicked
signal checkBoxToggled
@@ -42,9 +47,10 @@ Item {
}
Welcome_splash {
+ scale: root.mainScale
id: welcome_splash
- x: 0
- y: 0
+
+ transformOrigin: Item.TopLeft
antialiasing: true
onCloseClicked: root.closeClicked()
onConfigureClicked: root.configureClicked()