From 2213765a39bf9206d4c91bcfca0b0fb7a591b6d3 Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Thu, 17 Jun 2021 15:08:34 +0200 Subject: [PATCH] Some changes to footer layout --- android/AndroidManifest.xml | 2 +- .../qml/Components/SpeedFlowChartPopup.qml | 4 +- resources/qml/Pages/StartPage.qml | 102 +++++++----------- 3 files changed, 44 insertions(+), 64 deletions(-) diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index ec293df..6c2852d 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,5 +1,5 @@ - + diff --git a/resources/qml/Components/SpeedFlowChartPopup.qml b/resources/qml/Components/SpeedFlowChartPopup.qml index 5456a8d..85d0d47 100644 --- a/resources/qml/Components/SpeedFlowChartPopup.qml +++ b/resources/qml/Components/SpeedFlowChartPopup.qml @@ -8,8 +8,8 @@ Rectangle { property var flowchartData: ({}) // always unlock in debug mode - //property bool unlocked: QT_DEBUG || appSettings.read("speedBackendPurchase") === "1" - property bool unlocked: appSettings.read("speedBackendPurchase") === "1" + property bool unlocked: QT_DEBUG || appSettings.read("speedBackendPurchase") === "1" + //property bool unlocked: appSettings.read("speedBackendPurchase") === "1" state: "hidden" diff --git a/resources/qml/Pages/StartPage.qml b/resources/qml/Pages/StartPage.qml index ada954e..5878095 100644 --- a/resources/qml/Pages/StartPage.qml +++ b/resources/qml/Pages/StartPage.qml @@ -44,27 +44,16 @@ Page { GridLayout { id: menuGr - anchors { - top: headerBadge.bottom - bottom: bottomDigitalrockDisclaimerLabel.top - left: parent.left - right: parent.right - margins: headerBadge.anchors.topMargin - } + anchors.centerIn: parent - rows: app.landscape() ? 1:5 - columns: app.landscape() ? 5:1 + rows: app.landscape() ? 1:2 + columns: app.landscape() ? 2: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 @@ -93,68 +82,58 @@ Page { app.openWidget({nation:"SUI"}) } } + } - Item { - Layout.fillHeight: true - visible: !app.landscape() + GridLayout { + id: footerMenu + + anchors { + bottom: parent.bottom + margins: headerBadge.anchors.topMargin + horizontalCenter: parent.horizontalCenter } - 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() ? 4:2 + rows: app.landscape() ? 1:2 - columns: app.landscape() ? 1:2 - rows: app.landscape() ? 4:2 + Repeater { + id: buttonRepeater + property var buttons: [ + ["\uf059", "IFSC results", ifscDisclaimerDialog.open], + ["\uf042", Material.theme === Material.Light ? "Dark mode":"Light mode", app.toggleDarkMode], + ["\uf05a", "About blueROCK", aboutBluerockDisclaimerDialog.open], + ["\uf029", "Scan QR code", null], + ] - 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 - model: buttons + delegate: Item { - delegate: Button { - Layout.fillWidth: true + Layout.preferredWidth: app.landscape() ? footerMenuButton.implicitWidth : root.width * 0.5 - (footerMenu.columnSpacing / 2) + Layout.preferredHeight: footerMenuButton.implicitHeight + + Button { + id: footerMenuButton + property bool isLeft: index % 2 === 0 + + anchors { + right: isLeft && !app.landscape() ? parent.right : undefined + left: isLeft && !app.landscape() ? undefined : parent.left + centerIn: app.landscape() ? parent : undefined + } flat: true font.family: fa5solid.name font.pixelSize: height * 0.4 font.capitalization: Font.MixedCase + //horizontalAlignment: isLeft ? Text.AlignRight : Text.AlignLeft - text: modelData[0] + text: isLeft && !app.landscape() ? modelData[1] + " " + modelData[0] : modelData[0] + " " + modelData[1] - onClicked: buttonRepeater.buttons[index][1]() - } + onClicked: buttonRepeater.buttons[index][2]() + } } - } - } - - 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) } } @@ -176,7 +155,8 @@ Page { "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." + "the source code can be found here.

" + + "Resultservice and rankings provided by digital ROCK." }