Some changes to footer layout

This commit is contained in:
Dorian Zedler 2021-06-17 15:08:34 +02:00
parent c62af2e172
commit 2213765a39
Signed by: dorian
GPG key ID: 989DE36109AFA354
3 changed files with 44 additions and 64 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<manifest package="com.itsblue.blueROCK" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="-- %%INSERT_VERSION_NAME%% --" android:versionCode="-- %%INSERT_VERSION_CODE%% --" android:installLocation="auto"> <manifest package="com.itsblue.blueROCKtest" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="-- %%INSERT_VERSION_NAME%% --" android:versionCode="-- %%INSERT_VERSION_CODE%% --" android:installLocation="auto">
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application. <!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
Remove the comment if you do not require these default permissions. --> Remove the comment if you do not require these default permissions. -->
<!-- %%INSERT_PERMISSIONS --> <!-- %%INSERT_PERMISSIONS -->

View file

@ -8,8 +8,8 @@ Rectangle {
property var flowchartData: ({}) property var flowchartData: ({})
// always unlock in debug mode // always unlock in debug mode
//property bool unlocked: QT_DEBUG || appSettings.read("speedBackendPurchase") === "1" property bool unlocked: QT_DEBUG || appSettings.read("speedBackendPurchase") === "1"
property bool unlocked: appSettings.read("speedBackendPurchase") === "1" //property bool unlocked: appSettings.read("speedBackendPurchase") === "1"
state: "hidden" state: "hidden"

View file

@ -44,27 +44,16 @@ Page {
GridLayout { GridLayout {
id: menuGr id: menuGr
anchors { anchors.centerIn: parent
top: headerBadge.bottom
bottom: bottomDigitalrockDisclaimerLabel.top
left: parent.left
right: parent.right
margins: headerBadge.anchors.topMargin
}
rows: app.landscape() ? 1:5 rows: app.landscape() ? 1:2
columns: app.landscape() ? 5:1 columns: app.landscape() ? 2:1
rowSpacing: app.landscape() ? parent.width * 0.1:headerBadge.anchors.topMargin rowSpacing: app.landscape() ? parent.width * 0.1:headerBadge.anchors.topMargin
columnSpacing: rowSpacing columnSpacing: rowSpacing
property int buttonSize: app.landscape() ? parent.width * 0.2:parent.height * 0.19 property int buttonSize: app.landscape() ? parent.width * 0.2:parent.height * 0.19
Item {
Layout.fillHeight: true
Layout.preferredWidth: 0
}
FancyButton { FancyButton {
id: davBt id: davBt
@ -93,68 +82,58 @@ Page {
app.openWidget({nation:"SUI"}) app.openWidget({nation:"SUI"})
} }
} }
}
Item { GridLayout {
Layout.fillHeight: true id: footerMenu
visible: !app.landscape()
anchors {
bottom: parent.bottom
margins: headerBadge.anchors.topMargin
horizontalCenter: parent.horizontalCenter
} }
GridLayout { columns: app.landscape() ? 4:2
Layout.preferredHeight: app.landscape() ? menuGr.buttonSize : menuGr.buttonSize / 2 rows: app.landscape() ? 1:2
Layout.maximumWidth: app.landscape() ? menuGr.buttonSize : menuGr.buttonSize * 2
Layout.alignment: Layout.Center
columns: app.landscape() ? 1:2 Repeater {
rows: app.landscape() ? 4:2 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 { model: buttons
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: Item {
delegate: Button { Layout.preferredWidth: app.landscape() ? footerMenuButton.implicitWidth : root.width * 0.5 - (footerMenu.columnSpacing / 2)
Layout.fillWidth: true 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 flat: true
font.family: fa5solid.name font.family: fa5solid.name
font.pixelSize: height * 0.4 font.pixelSize: height * 0.4
font.capitalization: Font.MixedCase 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 <a href='http://www.digitalROCK.de'>digital ROCK</a>."
onLinkActivated: {
Qt.openUrlExternally(link)
} }
} }
@ -176,7 +155,8 @@ Page {
"licensed under the <a href='https://www.gnu.org/licenses/lgpl-3.0.en.html'>GNU lgplV3 license</a>.<br><br>"+ "licensed under the <a href='https://www.gnu.org/licenses/lgpl-3.0.en.html'>GNU lgplV3 license</a>.<br><br>"+
"This app is open source and licensed under the <a href='https://www.gnu.org/licenses/agpl-3.0.en.html'>GNU agplV3 license</a>," + "This app is open source and licensed under the <a href='https://www.gnu.org/licenses/agpl-3.0.en.html'>GNU agplV3 license</a>," +
"the source code can be found <a href='https://itsblue.dev/dorian/blueROCK/'>here</a>." "the source code can be found <a href='https://itsblue.dev/dorian/blueROCK/'>here</a>.<br><br>" +
"Resultservice and rankings provided by <a href='http://www.digitalROCK.de'>digital ROCK</a>."
} }