Added basic stuff to enable developing of settings tab
This commit is contained in:
1
qml.qrc
1
qml.qrc
@ -15,5 +15,6 @@
|
||||
<file>qml/BottomLine.qml</file>
|
||||
<file>qml/StatsLabel.qml</file>
|
||||
<file>qml/qmldir</file>
|
||||
<file>qml/settings.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -37,6 +37,7 @@ GamePage {
|
||||
contentHeight: contentColumn.height
|
||||
flickableDirection: Flickable.VerticalFlick
|
||||
clip: true
|
||||
anchors.margins: 5
|
||||
|
||||
Column {
|
||||
id: contentColumn
|
||||
@ -68,7 +69,7 @@ GamePage {
|
||||
wrapMode: Text.WordWrap
|
||||
text: "Front: " + Number(deviceHandler.frontVoltage).toLocaleString(Qt.locale()) + "V / " + Number(deviceHandler.frontTemperature).toLocaleString(Qt.locale()) + "°C"
|
||||
color: GameSettings.textColor
|
||||
minimumPixelSize: 10
|
||||
//minimumPixelSize: 10
|
||||
font.pixelSize: GameSettings.mediumFontSize
|
||||
}
|
||||
|
||||
@ -120,7 +121,7 @@ GamePage {
|
||||
text: "Back: " + Number(deviceHandler.backVoltage).toLocaleString(Qt.locale()) + "V / " + Number(deviceHandler.backTemperature).toLocaleString(Qt.locale()) + "°C"
|
||||
//visible: deviceHandler.alive
|
||||
color: GameSettings.textColor
|
||||
minimumPixelSize: 10
|
||||
//minimumPixelSize: 10
|
||||
font.pixelSize: GameSettings.mediumFontSize
|
||||
}
|
||||
|
||||
@ -153,22 +154,45 @@ GamePage {
|
||||
}
|
||||
}
|
||||
|
||||
GameButton {
|
||||
id: startButton
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
Row {
|
||||
id: buttonRow
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: GameSettings.fieldMargin
|
||||
width: container.width
|
||||
height: GameSettings.fieldHeight
|
||||
radius: GameSettings.buttonRadius
|
||||
spacing: 5
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
onClicked: app.showPage("RemoteControl.qml")
|
||||
width: childrenRect.width
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
font.pixelSize: GameSettings.tinyFontSize
|
||||
text: qsTr("REMOTE")
|
||||
color: startButton.enabled ? GameSettings.textColor : GameSettings.disabledTextColor
|
||||
GameButton {
|
||||
id: startButton
|
||||
width: container.width / 2
|
||||
height: GameSettings.fieldHeight
|
||||
radius: GameSettings.buttonRadius
|
||||
|
||||
onClicked: app.showPage("RemoteControl.qml")
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
font.pixelSize: GameSettings.tinyFontSize
|
||||
text: qsTr("REMOTE")
|
||||
color: startButton.enabled ? GameSettings.textColor : GameSettings.disabledTextColor
|
||||
}
|
||||
}
|
||||
|
||||
GameButton {
|
||||
id: settingsButton
|
||||
width: container.width / 2
|
||||
height: GameSettings.fieldHeight
|
||||
radius: GameSettings.buttonRadius
|
||||
|
||||
onClicked: app.showPage("settings.qml", 3)
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
font.pixelSize: GameSettings.tinyFontSize
|
||||
text: qsTr("SETTINGS")
|
||||
color: settingsButton.enabled ? GameSettings.textColor : GameSettings.disabledTextColor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,21 +8,23 @@ Rectangle {
|
||||
height: GameSettings.fieldHeight
|
||||
color: GameSettings.viewColor
|
||||
|
||||
property var __titles: ["CONNECT", "LIVEDATA", "REMOTECONTROL"]
|
||||
property var __titles: ["CONNECT", "LIVEDATA", "REMOTECONTROL", "SETTINGS"]
|
||||
property int currentIndex: 0
|
||||
|
||||
signal titleClicked(int index)
|
||||
|
||||
Repeater {
|
||||
model: 3
|
||||
model: 4
|
||||
Text {
|
||||
width: titleBar.width / 3
|
||||
width: titleBar.width / 4
|
||||
height: titleBar.height
|
||||
x: index * width
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
//text: GameSettings.hugeFontSize * 0.4
|
||||
//text: currentIndex
|
||||
text: __titles[index]
|
||||
font.pixelSize: GameSettings.tinyFontSize
|
||||
font.pixelSize: GameSettings.hugeFontSize * 0.3
|
||||
color: titleBar.currentIndex === index ? GameSettings.textColor : GameSettings.disabledTextColor
|
||||
|
||||
MouseArea {
|
||||
@ -35,7 +37,7 @@ Rectangle {
|
||||
|
||||
Item {
|
||||
anchors.bottom: parent.bottom
|
||||
width: parent.width / 3
|
||||
width: parent.width / 4
|
||||
height: parent.height
|
||||
x: currentIndex * width
|
||||
|
||||
|
31
qml/settings.qml
Normal file
31
qml/settings.qml
Normal file
@ -0,0 +1,31 @@
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
GamePage {
|
||||
id: livedatePage
|
||||
|
||||
errorMessage: deviceHandler.error
|
||||
infoMessage: deviceHandler.info
|
||||
|
||||
function close()
|
||||
{
|
||||
deviceHandler.disconnectService();
|
||||
app.prevPage();
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: container
|
||||
anchors.centerIn: parent
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.min(livedatePage.width, livedatePage.height-GameSettings.fieldHeight*4) - 2*GameSettings.fieldMargin
|
||||
height: livedatePage.height-GameSettings.fieldHeight*4
|
||||
radius: GameSettings.buttonRadius
|
||||
color: GameSettings.viewColor
|
||||
|
||||
Text {
|
||||
id: test
|
||||
text: qsTr("text")
|
||||
color: "white"
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user