app/resources/qml/Pages/StartPage.qml
Dorian Zedler 0b055bc2c1
- remove IFSC stuff
- new design for startpage
- some rework
2021-06-05 21:18:21 +02:00

176 lines
4.3 KiB
QML

/*
blueROCK - for digital rock
Copyright (C) 2019 Dorian Zedler
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.9
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.0
import "../Components"
Page {
id: root
title: "start"
signal headerComponentChanged()
RowLayout {
id: headerLayout
anchors {
horizontalCenter: parent.horizontalCenter
top: parent.top
topMargin: root.height * 0.03
}
height: menuGr.buttonSize * 0.3
spacing: anchors.topMargin * 0.5
Image {
Layout.preferredHeight: parent.height
Layout.preferredWidth: height
fillMode: Image.PreserveAspectFit
mipmap: true
source: "qrc:/icons/blueRockHold.png"
}
Label {
Layout.preferredHeight: parent.height
Layout.fillWidth: true
font.pixelSize: parent.height * 0.6
font.bold: true
verticalAlignment: Text.AlignVCenter
text: "blueROCK"
}
}
Grid {
id: menuGr
anchors.centerIn: parent
rows: app.landscape() ? 1:2
columns: app.landscape() ? 2:1
spacing: !app.landscape() ? parent.height * 0.08:parent.width * 0.1
property int buttonSize: app.landscape() ? parent.width * 0.2:parent.height * 0.2
FancyButton {
id: davBt
height: menuGr.buttonSize
width: height
image: "qrc:/icons/dav.png"
onClicked: {
app.openWidget({nation:"GER"})
}
}
FancyButton {
id: sacBt
height: menuGr.buttonSize
width: height
image: "qrc:/icons/sac.png"
onClicked: {
app.openWidget({nation:"SUI"})
}
}
}
ToolButton {
id: ifscDisclaimerButton
anchors {
horizontalCenter: parent.horizontalCenter
bottom: bottomDigitalrockDisclaimerLabel.top
}
text: "WHERE ARE THE IFSC RESULTS?"
font.bold: true
onClicked: ifscDisclaimerDialog.open()
}
Label {
id: bottomDigitalrockDisclaimerLabel
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
bottomMargin: headerLayout.anchors.topMargin
}
width: parent.width * 0.9
height: anchors.bottomMargin
fontSizeMode: Label.Fit
minimumPixelSize: 1
horizontalAlignment: Text.AlignHCenter
text: "Resultservice and rankings provided by <a href='http://www.digitalROCK.de'>digital ROCK</a>."
onLinkActivated: {
Qt.openUrlExternally(link)
}
}
Dialog {
id: ifscDisclaimerDialog
parent: Overlay.overlay
x: (parent.width - width) * 0.5
y: (parent.height - height) * 0.5
width: parent.width * 0.8
height: implicitHeight
title: "Where are the IFSC results?"
modal: true
standardButtons: Dialog.Close
contentItem: Label {
wrapMode: Text.Wrap
text:
"Unfortunately, the IFSC has restricted the access to their data and <b>is not willing to share results with blueROCK anymore</b>. " +
"Because of this, blueROCK is no longer able to access and display IFSC results.<br><br>" +
"You can find current IFSC results <a href=\"https://ifsc.results.info\">over here</a> and on <a href=\"https://ifsc-climbing.org\">their website</a>."
onLinkActivated: {
Qt.openUrlExternally(link)
}
}
}
}