diff --git a/LedDisplayController/leddisplaybackend.cpp b/LedDisplayController/leddisplaybackend.cpp index c328caa..09d5b8c 100644 --- a/LedDisplayController/leddisplaybackend.cpp +++ b/LedDisplayController/leddisplaybackend.cpp @@ -138,7 +138,7 @@ void LedDisplayBackend::sendBluetoothCommand(OmobiDisplayCommand command, QVaria QJsonDocument doc = QJsonDocument::fromVariant(commandMap); - //qDebug() << "Sending command: \n" << qPrintable(doc.toJson(QJsonDocument::Indented)); + qDebug() << "Sending command: \n" << qPrintable(doc.toJson(QJsonDocument::Compact)); this->waitingCommands ++; diff --git a/LedDisplayController/ressources/qml/Chip.qml b/LedDisplayController/ressources/qml/Chip.qml index c585674..cafc88c 100644 --- a/LedDisplayController/ressources/qml/Chip.qml +++ b/LedDisplayController/ressources/qml/Chip.qml @@ -18,10 +18,11 @@ Item { property double glowSpread: 0.01 property bool glowVisible: true property double glowScale: 1 - property double glowOpacity: Math.pow( control.opacity, 100 ) * 0.5 + property double glowOpacity: Math.pow( control.opacity, 1000 ) * 0.3 property bool interactive: true property int horizontalPadding: width * 0.15 property int verticalPadding: height * 0.15 + property int radius: height * 0.5 signal clicked @@ -56,7 +57,7 @@ Item { id: background anchors.fill: parent color: control.color - radius: height * 0.5 + radius: control.radius clip: true Behavior on color { @@ -82,7 +83,7 @@ Item { height: ripple.height Rectangle { anchors.fill: parent - radius: Math.min(width, height) * 0.5 + radius: control.radius } } } diff --git a/LedDisplayController/ressources/qml/ConnectedPage.qml b/LedDisplayController/ressources/qml/ConnectedPage.qml index c9b7996..0999c91 100644 --- a/LedDisplayController/ressources/qml/ConnectedPage.qml +++ b/LedDisplayController/ressources/qml/ConnectedPage.qml @@ -32,78 +32,108 @@ Page { margins: Math.min(parent.height, parent.width) * 0.05 } - Chip { - Layout.fillWidth: true - Layout.preferredHeight: 35 - 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 - - Text { - Layout.fillHeight: true - verticalAlignment: Text.AlignVCenter - font.pixelSize: parent.height * 0.5 - font.family: fontAwesome.name - text: "\uf186" - } - - Slider { - id: brightnessSlider - Layout.fillWidth: true - Layout.fillHeight: true - - from: 0 - to: 50 - stepSize: 1 - - value: backend.displayBrightness.displayBrightness - - onPressedChanged: { - if(!pressed) { - backend.displayBrightness = { - "displayBrightness": value, - "automaticBrightnessAdjustment": false - } - } - } - - ToolTip { - parent: brightnessSlider.handle - visible: brightnessSlider.pressed - text: brightnessSlider.value - } - } - - Text { - Layout.fillHeight: true - verticalAlignment: Text.AlignVCenter - font.pixelSize: parent.height * 0.5 - font.family: fontAwesome.name - text: "\uf185" - } - } - } - - Item { - Layout.fillWidth: true - Layout.preferredHeight: mainLayout.height * 0.025 - } - DisplayTextModelListView { + id: displayTextModelListView Layout.preferredWidth: parent.width Layout.fillHeight: true Layout.alignment: Layout.Center - clip: true + header: Item { + + width: parent.width + height: 100 + mainLayout.anchors.margins + + Chip { + + anchors { + top: parent.top + left: parent.left + right: parent.right + } + + height: 100 + radius: height * 0.2 + + interactive: false + + color: "white" + + Column { + + anchors.fill: parent + anchors.margins: height * 0.05 + + SwitchDelegate { + id: autoBrightnessSwitch + width: parent.width + height: parent.height / 2 + + checked: backend.displayBrightness.automaticBrightnessAdjustment + + text: qsTr("Automically adjust brightness") + + onCheckedChanged: { + backend.displayBrightness = { + "displayBrightness": brightnessSlider.value, + "automaticBrightnessAdjustment": autoBrightnessSwitch.checked + } + + } + } + + RowLayout { + width: parent.width - autoBrightnessSwitch.padding * 2 + height: parent.height / 2 + spacing: mainLayout.anchors.margins + + anchors.horizontalCenter: parent.horizontalCenter + + Text { + Layout.fillHeight: true + verticalAlignment: Text.AlignVCenter + font.pixelSize: parent.height * 0.5 + font.family: fontAwesome.name + text: "\uf186" + } + + Slider { + id: brightnessSlider + Layout.fillWidth: true + Layout.fillHeight: true + + from: 0 + to: 50 + stepSize: 1 + + value: backend.displayBrightness.displayBrightness + + onPressedChanged: { + if(!pressed) { + backend.displayBrightness = { + "displayBrightness": value, + "automaticBrightnessAdjustment": autoBrightnessSwitch.checked + } + } + } + + ToolTip { + parent: brightnessSlider.handle + visible: brightnessSlider.pressed + text: brightnessSlider.value + } + } + + Text { + Layout.fillHeight: true + verticalAlignment: Text.AlignVCenter + font.pixelSize: parent.height * 0.5 + font.family: fontAwesome.name + text: "\uf185" + } + } + } + } + } } } diff --git a/LedDisplayController/ressources/qml/DisplayEditDialog.qml b/LedDisplayController/ressources/qml/DisplayEditDialog.qml index c772dcf..2769cc4 100644 --- a/LedDisplayController/ressources/qml/DisplayEditDialog.qml +++ b/LedDisplayController/ressources/qml/DisplayEditDialog.qml @@ -57,13 +57,13 @@ Dialog { Button { flat: true enabled: nameTextField.value !== "" - text: "save" + text: qsTr("save") DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole } Button { flat: true - text: "cancel" + text: qsTr("cancel") DialogButtonBox.buttonRole: DialogButtonBox.RejectRole } } diff --git a/LedDisplayController/ressources/qml/TextEditDialog.qml b/LedDisplayController/ressources/qml/TextEditDialog.qml index 54dc6bb..829e3ef 100644 --- a/LedDisplayController/ressources/qml/TextEditDialog.qml +++ b/LedDisplayController/ressources/qml/TextEditDialog.qml @@ -21,7 +21,7 @@ Dialog { modal: true - title: editing ? "Edit item" : "New item" + title: editing ? qsTr("Edit text") : qsTr("New text") onAccepted: { if(editing) { @@ -112,8 +112,8 @@ Dialog { ComboBoxDelegate { id: scrollDirectionComboBox Layout.fillWidth: true - model: [qsTr("right to left"), qsTr("left to right")] - text: qsTr("Scroll direction") + model: [qsTr("from right to left"), qsTr("from left to right")] + text: qsTr("Scroll") } SpinBoxDelegate { @@ -144,13 +144,13 @@ Dialog { Button { flat: true enabled: textTextField.value !== "" - text: "save" + text: qsTr("save") DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole } Button { flat: true - text: "cancel" + text: qsTr("cancel") DialogButtonBox.buttonRole: DialogButtonBox.RejectRole } @@ -158,7 +158,7 @@ Dialog { visible: popup.editing Material.foreground: Material.Red flat: true - text: "delete" + text: qsTr("delete") DialogButtonBox.buttonRole: DialogButtonBox.DestructiveRole } } diff --git a/LedDisplayController/ressources/translations/de.qm b/LedDisplayController/ressources/translations/de.qm index 85034a0..13f0e2e 100644 Binary files a/LedDisplayController/ressources/translations/de.qm and b/LedDisplayController/ressources/translations/de.qm differ diff --git a/LedDisplayController/ressources/translations/de.ts b/LedDisplayController/ressources/translations/de.ts index 01dfa6c..ad50e67 100644 --- a/LedDisplayController/ressources/translations/de.ts +++ b/LedDisplayController/ressources/translations/de.ts @@ -84,6 +84,10 @@ Standort-Berechtigung verweigert! loading... laden... + + Automically adjust brightness + Helligkeit automatisch regeln + DisplayEditDialog @@ -109,6 +113,14 @@ Standort-Berechtigung verweigert! Enter new display code again Geben sie den neuen Display Code erneut ein + + save + speichern + + + cancel + abbrechen + DisplayTextDelegate @@ -171,6 +183,58 @@ Standort-Berechtigung verweigert! Scroll count Scrolldurchläufe + + Edit text + Text bearbeiten + + + New text + Neuer Text + + + left + links + + + center + mittig + + + right + rechts + + + right to left + von rechts nach links + + + left to right + von links nach rechts + + + Scroll direction + Scrollen + + + from right to left + von rechts nach links + + + from left to right + von links nach rechts + + + save + speichern + + + cancel + abbrechen + + + delete + löschen + main