From 67cf4bad193ce18f67acda4364a487552d9d5e50 Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Sun, 18 Oct 2020 22:42:42 +0200 Subject: [PATCH] - Added some more translations - Adjusted some sizes --- LedDisplayController/leddisplaybackend.cpp | 2 +- LedDisplayController/ressources/qml/Chip.qml | 7 +- .../ressources/qml/ConnectedPage.qml | 164 +++++++++++------- .../ressources/qml/DisplayEditDialog.qml | 4 +- .../ressources/qml/TextEditDialog.qml | 12 +- .../ressources/translations/de.qm | Bin 3872 -> 4871 bytes .../ressources/translations/de.ts | 64 +++++++ 7 files changed, 174 insertions(+), 79 deletions(-) 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 85034a0afbe926799916ad83656d4b2ce6356995..13f0e2e6dd97451ef2bfe7b936239c188a250f9e 100644 GIT binary patch delta 1039 zcmah`OK1~O6upzoC!fj37>a3Znp!N_mTq*Rr3j)Gs}i$N#6QVolBT8;%}n}RSaDNu zQ)R?fQK>@l7g{y8TB!IVAP6o*7X?8Dp}J9o;;zLr{iLlfI*-SF^X_@)o_p>t61t&4_Gcr~~2oFPQut{gxiW|+Hrxt7TBo6B9lK_qy1i?;~{`}xwkO%OD} z_cx8>-Tk@fV)$!^UxBxQ&()$a*J(@c;Y;W#SfzuL5OUkLCH0d|5_`|~=xZ1k>+R;z zGa&wD7fQ2G_|5)h`VyS!v`@W}(4p5pHKXCbT9gJpLeL?x@9tv=lEj;p8;Dl1j(Y!A zI2d!xjMky=z0MJ44EbBGJ;SfT+oqQ@C4%Tr0(&&yz;p@S^|Xs*N?|1_0WC73MnQ^D z7BNk&IBB?3Nup-lXMjk|zECWNw>);)wyc(JO-hkesxuggwPaN-7|kRT&6*;sssMyz zds2SsMX?NOqliq4)Vvf?BsrzOu=*=J5OE6Gi*;rw&{W3t zth1)+Ffj0xvaXps4`_-I8;6J|0|SRVo0Ogj(3UwIYc?KaU|=}PnH>HcXzms+%ba%% z3@od-Ha!dg@{PEex77jlm2tC6l`$F%u8PX^;;b8flG^Z9Z%d-2CJPF^Dv4FKO}QuhD= 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