From dc8e13995ab43fd1c05ec40ea876f5208869aa38 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Fri, 19 Aug 2022 12:41:23 +0200 Subject: [PATCH] StudioWelcome: Scale down splash screen if it does not fit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Reviewed-by: Henning Gründl --- .../qml/splashscreen/Welcome_splash.qml | 5 ++--- .../studiowelcome/qml/splashscreen/main.qml | 14 ++++++++++---- 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 153436278ee..73c4eded2bc 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 b60e4668cb0..ee68681ab5f 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()