LedDisplay/OmobiDisplayApp/ressources/qml/ConnectedPage.qml

139 lines
3 KiB
QML

import QtQuick 2.0
import QtQuick.Controls 2.9
import QtQuick.Layouts 1.0
import QtQuick.Controls.Material 2.0
import QtGraphicalEffects 1.0
import de.itsblue.omobidisplayapp 1.0
import de.itsblue.bluetoothleuart 1.0
Page {
id: root
ColumnLayout {
anchors {
fill: parent
margins: parent.height * 0.01
topMargin: 0
}
Text {
Layout.preferredWidth: parent.width * 0.6
Layout.preferredHeight: parent.height * 0.1
Layout.alignment: Layout.Center
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
fontSizeMode: Text.Fit
font.pixelSize: 500
minimumPixelSize: 1
color: root.Material.foreground
text: backend.bleController.currentDevice === null ? "":backend.bleController.currentDevice.name
ToolButton {
id: editButton
anchors {
verticalCenter: parent.verticalCenter
left: parent.right
margins: parent.height * 0.1
}
height: parent.height * 0.7
width: height
font.styleName: fontAwesome.name
font.pixelSize: height * 0.3
flat: true
text: "\uf044"
onClicked: displayEditDialog.edit()
}
}
Text {
Layout.alignment: Layout.Center
color: root.Material.foreground
text: qsTr("Brightness:")
}
Slider {
Layout.fillWidth: true
from: 0
to: 10
stepSize: 1
value: backend.displayBrightness
onPressedChanged: {
if(!pressed)
backend.displayBrightness = value
}
}
DisplayTextModelListView {
Layout.preferredWidth: parent.width
Layout.fillHeight: true
Layout.alignment: Layout.Center
clip: true
}
}
DisplayEditDialog {
id: displayEditDialog
}
Dialog {
id: loadingDialog
property bool shouldBeOpen: false
onShouldBeOpenChanged: {
if(shouldBeOpen)
open()
else
close()
}
parent: Overlay.overlay
x: (parent.width - width) / 2
y: (parent.height - height) / 2
closePolicy: Popup.NoAutoClose
modal: true
contentItem: ColumnLayout {
BusyIndicator {
}
Text {
Layout.alignment: Layout.Center
text: qsTr("loading...")
}
}
}
states: [
State {
name: OmobiDisplayBackend.Connected
},
State {
name: OmobiDisplayBackend.Loading
PropertyChanges {
target: loadingDialog
shouldBeOpen: true
}
}
]
}