2023-12-21 10:33:52 +01:00
|
|
|
// 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 WelcomeScreen 1.0
|
|
|
|
|
import StudioTheme 1.0 as StudioTheme
|
|
|
|
|
|
|
|
|
|
Item {
|
2024-01-18 18:22:46 +01:00
|
|
|
id: figmaButton
|
2023-12-21 10:33:52 +01:00
|
|
|
state: "darkNormal"
|
|
|
|
|
|
|
|
|
|
property bool isHovered: mouseArea.containsMouse
|
|
|
|
|
|
|
|
|
|
Image {
|
2024-01-18 18:22:46 +01:00
|
|
|
id: figmaDarkNormal
|
2023-12-21 10:33:52 +01:00
|
|
|
anchors.fill: parent
|
2024-01-18 18:22:46 +01:00
|
|
|
source: "images/figmaDarkNormal.png"
|
2023-12-21 10:33:52 +01:00
|
|
|
fillMode: Image.PreserveAspectFit
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Image {
|
2024-01-18 18:22:46 +01:00
|
|
|
id: figmaLightNormal
|
2023-12-21 10:33:52 +01:00
|
|
|
anchors.fill: parent
|
2024-01-18 18:22:46 +01:00
|
|
|
source: "images/figmaLightNormal.png"
|
2023-12-21 10:33:52 +01:00
|
|
|
fillMode: Image.PreserveAspectFit
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Image {
|
2024-01-18 18:22:46 +01:00
|
|
|
id: figmaHover
|
2023-12-21 10:33:52 +01:00
|
|
|
anchors.fill: parent
|
2024-01-18 18:22:46 +01:00
|
|
|
source: "images/figmaHover.png"
|
2023-12-21 10:33:52 +01:00
|
|
|
fillMode: Image.PreserveAspectFit
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
|
id: mouseArea
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
hoverEnabled: true
|
|
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
|
target: mouseArea
|
2024-01-18 18:22:46 +01:00
|
|
|
function onClicked(mouse) { Qt.openUrlExternally("https://www.figma.com/@qtdesignstudio/") }
|
2023-12-21 10:33:52 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
states: [
|
|
|
|
|
State {
|
|
|
|
|
name: "darkNormal"
|
|
|
|
|
when: !StudioTheme.Values.isLightTheme && !mouseArea.containsMouse && !mouseArea.pressed
|
|
|
|
|
|
|
|
|
|
PropertyChanges {
|
2024-01-18 18:22:46 +01:00
|
|
|
target: figmaDarkNormal
|
2023-12-21 10:33:52 +01:00
|
|
|
visible: true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyChanges {
|
2024-01-18 18:22:46 +01:00
|
|
|
target: figmaLightNormal
|
2023-12-21 10:33:52 +01:00
|
|
|
visible: false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyChanges {
|
2024-01-18 18:22:46 +01:00
|
|
|
target: figmaHover
|
2023-12-21 10:33:52 +01:00
|
|
|
visible: false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
State {
|
|
|
|
|
name: "lightNormal"
|
|
|
|
|
when: StudioTheme.Values.isLightTheme && !mouseArea.containsMouse && !mouseArea.pressed
|
|
|
|
|
|
|
|
|
|
PropertyChanges {
|
2024-01-18 18:22:46 +01:00
|
|
|
target: figmaHover
|
2023-12-21 10:33:52 +01:00
|
|
|
visible: false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyChanges {
|
2024-01-18 18:22:46 +01:00
|
|
|
target: figmaLightNormal
|
2023-12-21 10:33:52 +01:00
|
|
|
visible: true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyChanges {
|
2024-01-18 18:22:46 +01:00
|
|
|
target: figmaDarkNormal
|
2023-12-21 10:33:52 +01:00
|
|
|
visible: false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
State {
|
|
|
|
|
name: "hover"
|
|
|
|
|
when: mouseArea.containsMouse && !mouseArea.pressed
|
|
|
|
|
|
|
|
|
|
PropertyChanges {
|
2024-01-18 18:22:46 +01:00
|
|
|
target: figmaHover
|
2023-12-21 10:33:52 +01:00
|
|
|
visible: true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyChanges {
|
2024-01-18 18:22:46 +01:00
|
|
|
target: figmaLightNormal
|
2023-12-21 10:33:52 +01:00
|
|
|
visible: false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyChanges {
|
2024-01-18 18:22:46 +01:00
|
|
|
target: figmaDarkNormal
|
2023-12-21 10:33:52 +01:00
|
|
|
visible: false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
State {
|
|
|
|
|
name: "press"
|
|
|
|
|
when: (mouseArea.containsMouse || !mouseArea.containsMouse) && mouseArea.pressed
|
|
|
|
|
|
|
|
|
|
PropertyChanges {
|
2024-01-18 18:22:46 +01:00
|
|
|
target: figmaHover
|
2023-12-21 10:33:52 +01:00
|
|
|
visible: true
|
|
|
|
|
scale: 1.1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyChanges {
|
2024-01-18 18:22:46 +01:00
|
|
|
target: figmaLightNormal
|
2023-12-21 10:33:52 +01:00
|
|
|
visible: false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyChanges {
|
2024-01-18 18:22:46 +01:00
|
|
|
target: figmaDarkNormal
|
2023-12-21 10:33:52 +01:00
|
|
|
visible: false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|