- Added some more translations

- Adjusted some sizes
This commit is contained in:
Dorian Zedler 2020-10-18 22:42:42 +02:00
parent d18eb3cce3
commit 67cf4bad19
Signed by: dorian
GPG key ID: D3B255CB8BC7CD37
7 changed files with 174 additions and 79 deletions

View file

@ -138,7 +138,7 @@ void LedDisplayBackend::sendBluetoothCommand(OmobiDisplayCommand command, QVaria
QJsonDocument doc = QJsonDocument::fromVariant(commandMap); 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 ++; this->waitingCommands ++;

View file

@ -18,10 +18,11 @@ Item {
property double glowSpread: 0.01 property double glowSpread: 0.01
property bool glowVisible: true property bool glowVisible: true
property double glowScale: 1 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 bool interactive: true
property int horizontalPadding: width * 0.15 property int horizontalPadding: width * 0.15
property int verticalPadding: height * 0.15 property int verticalPadding: height * 0.15
property int radius: height * 0.5
signal clicked signal clicked
@ -56,7 +57,7 @@ Item {
id: background id: background
anchors.fill: parent anchors.fill: parent
color: control.color color: control.color
radius: height * 0.5 radius: control.radius
clip: true clip: true
Behavior on color { Behavior on color {
@ -82,7 +83,7 @@ Item {
height: ripple.height height: ripple.height
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
radius: Math.min(width, height) * 0.5 radius: control.radius
} }
} }
} }

View file

@ -32,21 +32,61 @@ Page {
margins: Math.min(parent.height, parent.width) * 0.05 margins: Math.min(parent.height, parent.width) * 0.05
} }
Chip { DisplayTextModelListView {
Layout.fillWidth: true id: displayTextModelListView
Layout.preferredHeight: 35 Layout.preferredWidth: parent.width
Layout.fillHeight: true
Layout.alignment: Layout.Center Layout.alignment: Layout.Center
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 interactive: false
color: "white" color: "white"
RowLayout { Column {
spacing: mainLayout.anchors.margins
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: width * 0.05 anchors.margins: height * 0.05
anchors.rightMargin: anchors.leftMargin
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 { Text {
Layout.fillHeight: true Layout.fillHeight: true
@ -71,7 +111,7 @@ Page {
if(!pressed) { if(!pressed) {
backend.displayBrightness = { backend.displayBrightness = {
"displayBrightness": value, "displayBrightness": value,
"automaticBrightnessAdjustment": false "automaticBrightnessAdjustment": autoBrightnessSwitch.checked
} }
} }
} }
@ -92,18 +132,8 @@ Page {
} }
} }
} }
Item {
Layout.fillWidth: true
Layout.preferredHeight: mainLayout.height * 0.025
} }
}
DisplayTextModelListView {
Layout.preferredWidth: parent.width
Layout.fillHeight: true
Layout.alignment: Layout.Center
clip: true
} }
} }

View file

@ -57,13 +57,13 @@ Dialog {
Button { Button {
flat: true flat: true
enabled: nameTextField.value !== "" enabled: nameTextField.value !== ""
text: "save" text: qsTr("save")
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
} }
Button { Button {
flat: true flat: true
text: "cancel" text: qsTr("cancel")
DialogButtonBox.buttonRole: DialogButtonBox.RejectRole DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
} }
} }

View file

@ -21,7 +21,7 @@ Dialog {
modal: true modal: true
title: editing ? "Edit item" : "New item" title: editing ? qsTr("Edit text") : qsTr("New text")
onAccepted: { onAccepted: {
if(editing) { if(editing) {
@ -112,8 +112,8 @@ Dialog {
ComboBoxDelegate { ComboBoxDelegate {
id: scrollDirectionComboBox id: scrollDirectionComboBox
Layout.fillWidth: true Layout.fillWidth: true
model: [qsTr("right to left"), qsTr("left to right")] model: [qsTr("from right to left"), qsTr("from left to right")]
text: qsTr("Scroll direction") text: qsTr("Scroll")
} }
SpinBoxDelegate { SpinBoxDelegate {
@ -144,13 +144,13 @@ Dialog {
Button { Button {
flat: true flat: true
enabled: textTextField.value !== "" enabled: textTextField.value !== ""
text: "save" text: qsTr("save")
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
} }
Button { Button {
flat: true flat: true
text: "cancel" text: qsTr("cancel")
DialogButtonBox.buttonRole: DialogButtonBox.RejectRole DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
} }
@ -158,7 +158,7 @@ Dialog {
visible: popup.editing visible: popup.editing
Material.foreground: Material.Red Material.foreground: Material.Red
flat: true flat: true
text: "delete" text: qsTr("delete")
DialogButtonBox.buttonRole: DialogButtonBox.DestructiveRole DialogButtonBox.buttonRole: DialogButtonBox.DestructiveRole
} }
} }

View file

@ -84,6 +84,10 @@ Standort-Berechtigung verweigert!</translation>
<source>loading...</source> <source>loading...</source>
<translation>laden...</translation> <translation>laden...</translation>
</message> </message>
<message>
<source>Automically adjust brightness</source>
<translation>Helligkeit automatisch regeln</translation>
</message>
</context> </context>
<context> <context>
<name>DisplayEditDialog</name> <name>DisplayEditDialog</name>
@ -109,6 +113,14 @@ Standort-Berechtigung verweigert!</translation>
<source>Enter new display code again</source> <source>Enter new display code again</source>
<translation>Geben sie den neuen Display Code erneut ein</translation> <translation>Geben sie den neuen Display Code erneut ein</translation>
</message> </message>
<message>
<source>save</source>
<translation>speichern</translation>
</message>
<message>
<source>cancel</source>
<translation>abbrechen</translation>
</message>
</context> </context>
<context> <context>
<name>DisplayTextDelegate</name> <name>DisplayTextDelegate</name>
@ -171,6 +183,58 @@ Standort-Berechtigung verweigert!</translation>
<source>Scroll count</source> <source>Scroll count</source>
<translation>Scrolldurchläufe</translation> <translation>Scrolldurchläufe</translation>
</message> </message>
<message>
<source>Edit text</source>
<translation>Text bearbeiten</translation>
</message>
<message>
<source>New text</source>
<translation>Neuer Text</translation>
</message>
<message>
<source>left</source>
<translation>links</translation>
</message>
<message>
<source>center</source>
<translation>mittig</translation>
</message>
<message>
<source>right</source>
<translation>rechts</translation>
</message>
<message>
<source>right to left</source>
<translation type="vanished">von rechts nach links</translation>
</message>
<message>
<source>left to right</source>
<translation type="vanished">von links nach rechts</translation>
</message>
<message>
<source>Scroll direction</source>
<translation type="vanished">Scrollen</translation>
</message>
<message>
<source>from right to left</source>
<translation>von rechts nach links</translation>
</message>
<message>
<source>from left to right</source>
<translation>von links nach rechts</translation>
</message>
<message>
<source>save</source>
<translation>speichern</translation>
</message>
<message>
<source>cancel</source>
<translation>abbrechen</translation>
</message>
<message>
<source>delete</source>
<translation>löschen</translation>
</message>
</context> </context>
<context> <context>
<name>main</name> <name>main</name>