Skip to content

Commit 17b8988

Browse files
authored
Merge pull request #355 from simelo/stdevCrow_Fix_Splash_Size
Set the size of the splash dialog from the implicit size
2 parents defa7e4 + 112539c commit 17b8988

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/ui/splash.qml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import QtQuick.Controls 2.12
33
import QtQuick.Controls.Material 2.12
44
import QtQuick.Window 2.12
55
import QtQuick.Layouts 1.12
6+
import Qt.labs.settings 1.0
67

78
Window {
89
id: windowSplash
@@ -15,6 +16,8 @@ Window {
1516
x: (Screen.width - width)/2
1617
y: (Screen.height - height)/2
1718

19+
Material.theme: ~~settings.value("style/material/theme", Material.Light)
20+
1821
Dialog {
1922
id: dialogSplash
2023
anchors.centerIn: Overlay.overlay
@@ -30,12 +33,12 @@ Window {
3033
onRejected: Qt.exit(-1)
3134
onClosed: windowSplash.visible = false
3235

33-
width: 300
34-
height: 300
35-
// The width/height must be always greater than its implicit version:
36-
// onAboutToShow: console.log("Size:", width + 'x' + height, "Implicit size:", implicitWidth + 'x' + implicitHeight)
36+
width: implicitWidth + (implicitWidth % 2)
37+
height: implicitHeight + (implicitHeight % 2)
3738

3839
ColumnLayout {
40+
anchors.fill: parent
41+
3942
Image {
4043
id: imageLogo
4144
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
@@ -94,4 +97,8 @@ Window {
9497
repeat: false
9598
onTriggered: dialogSplash.close()
9699
}
100+
101+
Settings {
102+
id: settings
103+
}
97104
}

0 commit comments

Comments
 (0)