Files
qt-creator/share/qtcreator/qmldesigner/welcomepage/TourDialogButton.qml
Thomas Hartmann b47e074f62 QmlDesigner: Add QML source
This adds the QML source for the Qt Design Studio Welcome page.
The source code was private before.

Change-Id: I5dcb900ed9a17b1bc3bbcaf50f649ebeb61cc8bf
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2024-01-17 09:46:02 +00:00

70 lines
1.6 KiB
QML

// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import QtQuick
import QtQuick.Controls
import WelcomeScreen 1.0
import StudioTheme 1.0 as StudioTheme
import UiTour
Item {
id: tourButton
width: 40
height: 40
property alias dialogButtonText: dialogButton.text
signal buttonClicked
Text {
id: dialogButton
color: "#ffffff"
font.family: StudioTheme.Constants.iconFont.family
text: StudioTheme.Constants.closeFile_large
font.pixelSize: 32
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
}
MouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
Connections {
target: mouseArea
onClicked: tourButton.buttonClicked()
}
}
states: [
State {
name: "normal"
when: !mouseArea.containsMouse && !mouseArea.pressed
PropertyChanges {
target: dialogButton
color: "#ecebeb"
font.pixelSize: 28
}
},
State {
name: "hover"
when: mouseArea.containsMouse && !mouseArea.pressed
PropertyChanges {
target: dialogButton
font.pixelSize: 29
}
},
State {
name: "press"
when: mouseArea.pressed
PropertyChanges {
target: dialogButton
font.pixelSize: 29
}
}
]
}