/* 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 . */ import QtQuick 2.9 import QtQuick.Controls 2.4 import QtQuick.Layouts 1.0 import QtQuick.Controls.Material 2.12 import "../Components" Page { id: root title: "start" signal headerComponentChanged() BlueRockBadge { id: headerBadge anchors { horizontalCenter: parent.horizontalCenter top: parent.top topMargin: root.height * 0.03 } height: menuGr.buttonSize * 0.3 } GridLayout { id: menuGr anchors { top: headerBadge.bottom bottom: bottomDigitalrockDisclaimerLabel.top left: parent.left right: parent.right margins: headerBadge.anchors.topMargin } rows: app.landscape() ? 1:5 columns: app.landscape() ? 5:1 rowSpacing: app.landscape() ? parent.width * 0.1:headerBadge.anchors.topMargin columnSpacing: rowSpacing property int buttonSize: app.landscape() ? parent.width * 0.2:parent.height * 0.19 Item { Layout.fillHeight: true Layout.preferredWidth: 0 } FancyButton { id: davBt Layout.preferredHeight: menuGr.buttonSize Layout.preferredWidth: menuGr.buttonSize Layout.alignment: Layout.Center image: Material.theme === Material.Dark ? "qrc:/icons/dav-dark.png":"qrc:/icons/dav.png" onClicked: { app.openWidget({nation:"GER"}) } } FancyButton { id: sacBt Layout.preferredHeight: menuGr.buttonSize Layout.preferredWidth: menuGr.buttonSize Layout.alignment: Layout.Center image: Material.theme === Material.Dark ? "qrc:/icons/sac-dark.png":"qrc:/icons/sac.png" onClicked: { app.openWidget({nation:"SUI"}) } } Item { Layout.fillHeight: true visible: !app.landscape() } GridLayout { Layout.preferredHeight: app.landscape() ? menuGr.buttonSize : menuGr.buttonSize / 2 Layout.maximumWidth: app.landscape() ? menuGr.buttonSize : menuGr.buttonSize * 2 Layout.alignment: Layout.Center columns: app.landscape() ? 1:2 rows: app.landscape() ? 4:2 Repeater { id: buttonRepeater property var buttons: [ ["\uf059 IFSC results", ifscDisclaimerDialog.open], ["\uf029 Scan QR code", null], [Material.theme === Material.Light ? "\uf042 Dark mode":"\uf042 Light mode", app.toggleDarkMode], ["\uf05a About blueROCK", aboutBluerockDisclaimerDialog.open] ] model: buttons delegate: Button { Layout.fillWidth: true flat: true font.family: fa5solid.name font.pixelSize: height * 0.4 font.capitalization: Font.MixedCase text: modelData[0] onClicked: buttonRepeater.buttons[index][1]() } } } } Label { id: bottomDigitalrockDisclaimerLabel anchors { horizontalCenter: parent.horizontalCenter bottom: parent.bottom bottomMargin: headerBadge.anchors.topMargin } width: parent.width * 0.9 height: anchors.bottomMargin fontSizeMode: Label.Fit minimumPixelSize: 1 horizontalAlignment: Text.AlignHCenter text: "Resultservice and rankings provided by digital ROCK." onLinkActivated: { Qt.openUrlExternally(link) } } DisclaimerDialog { id: ifscDisclaimerDialog Material.theme: root.Material.theme title: "Where are the IFSC results?" content: "Unfortunately, the IFSC has restricted the access to their data and is not willing to share results with blueROCK anymore. " + "Because of this, blueROCK is no longer able to access and display IFSC results.

" + "You can find current IFSC results over here and on their website." } DisclaimerDialog { id: aboutBluerockDisclaimerDialog Material.theme: root.Material.theme title: "blueROCK v" + APP_VERSION + "
By Itsblue Development" content: "This app was built using the Qt Framework " + "licensed under the GNU lgplV3 license.

"+ "This app is open source and licensed under the GNU agplV3 license," + "the source code can be found here." } }