LedDisplay/OmobiDisplayApp/ressources/qml/ConnectedPage.qml

156 lines
3.7 KiB
QML
Raw Normal View History

2020-10-11 15:50:13 +02:00
import QtQuick 2.0
import QtQuick.Controls 2.9
import QtQuick.Layouts 1.0
import QtQuick.Controls.Material 2.0
2020-10-17 03:22:37 +02:00
import QtGraphicalEffects 1.0
2020-10-11 15:50:13 +02:00
import de.itsblue.omobidisplayapp 1.0
import de.itsblue.bluetoothleuart 1.0
Page {
id: root
property bool actionButtonVisible: true
property bool backButtonVisible: true
title: backend.bleClient.currentDevice === null ? "":backend.bleClient.currentDevice.name
signal opened()
function backButtonClicked() {
backend.bleClient.disconnectFromDevice()
}
function actionButtonClicked() {
displayEditDialog.edit()
}
ColumnLayout {
id: mainLayout
anchors {
fill: parent
margins: Math.min(parent.height, parent.width) * 0.05
}
Chip {
Layout.fillWidth: true
Layout.preferredHeight: mainLayout.height * 0.05
Layout.alignment: Layout.Center
interactive: false
color: "white"
RowLayout {
spacing: mainLayout.anchors.margins
anchors.fill: parent
anchors.leftMargin: width * 0.05
anchors.rightMargin: anchors.leftMargin
2020-10-17 03:22:37 +02:00
Text {
Layout.fillHeight: true
verticalAlignment: Text.AlignVCenter
font.pixelSize: parent.height * 0.5
font.family: fontAwesome.name
text: "\uf186"
2020-10-17 03:22:37 +02:00
}
Slider {
id: brightnessSlider
Layout.fillWidth: true
Layout.fillHeight: true
2020-10-17 03:22:37 +02:00
from: 0
to: 255
stepSize: 1
2020-10-17 03:22:37 +02:00
value: backend.displayBrightness
2020-10-17 03:22:37 +02:00
onPressedChanged: {
if(!pressed)
backend.displayBrightness = value
}
ToolTip {
parent: brightnessSlider.handle
visible: brightnessSlider.pressed
text: brightnessSlider.value
}
}
2020-10-17 03:22:37 +02:00
Text {
Layout.fillHeight: true
verticalAlignment: Text.AlignVCenter
font.pixelSize: parent.height * 0.5
font.family: fontAwesome.name
text: "\uf185"
}
2020-10-17 03:22:37 +02:00
}
}
Item {
Layout.fillWidth: true
Layout.preferredHeight: mainLayout.height * 0.025
}
DisplayTextModelListView {
Layout.preferredWidth: parent.width
Layout.fillHeight: true
Layout.alignment: Layout.Center
clip: true
}
2020-10-11 15:50:13 +02:00
}
2020-10-17 03:22:37 +02:00
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
}
}
]
2020-10-11 15:50:13 +02:00
}