[branding] Add sponsor message support

This commit is contained in:
Artem Grinev 2023-11-29 14:03:09 +06:00
parent 8a91c36ad1
commit 5c770a230f

View File

@ -1,16 +1,16 @@
import QtQuick 2.15
import QtQml 2.15 import QtQml 2.15
import QtQuick 2.15
Item { Item {
id: root id: root
function onActivate(){ function onActivate() {
timer.restart(); timer.restart();
slider.reset(); slider.reset();
artwork.state = "nearGround"; artwork.state = "nearGround";
} }
function onLeave(){ function onLeave() {
} }
width: 800 width: 800
@ -18,13 +18,13 @@ Item {
Timer { Timer {
id: timer id: timer
interval: 20000 interval: 20000
running: false running: false
repeat: true repeat: true
onTriggered: slider.currentSlideIndex++ onTriggered: slider.currentSlideIndex++
} }
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
@ -35,13 +35,14 @@ Item {
Artwork { Artwork {
id: artwork id: artwork
anchors.fill: parent anchors.fill: parent
} }
Slider { Slider {
id: slider id: slider
height: 50
height: 50
slides: [ slides: [
Slide { Slide {
title: qsTr("Hello") title: qsTr("Hello")
@ -62,14 +63,57 @@ Item {
body: qsTr("It's time to relax and prepare for new adventures.") body: qsTr("It's time to relax and prepare for new adventures.")
footer: qsTr("Check our forum and wiki if you have any questions or feedback.") footer: qsTr("Check our forum and wiki if you have any questions or feedback.")
} }
] ]
anchors { anchors {
centerIn: parent centerIn: parent
horizontalCenterOffset: -100 horizontalCenterOffset: -100
verticalCenterOffset: -57 verticalCenterOffset: -57
} }
}
Row {
id: sponsoredBy
spacing: 5
anchors {
bottom: parent.bottom
right: parent.right
margins: 10
}
Text {
height: 30
font.family: "Montserrat"
color: "white"
text: qsTr("Brought to you by")
verticalAlignment: Text.AlignVCenter
}
Image {
source: "sponsor.svg"
onStatusChanged: {
if ((status == Image.Error))
sponsoredBy.visible = false;
}
sourceSize {
height: 30
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
Qt.openUrlExternally("./sponsor.html");
}
}
}
} }
} }