- 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);
//qDebug() << "Sending command: \n" << qPrintable(doc.toJson(QJsonDocument::Indented));
qDebug() << "Sending command: \n" << qPrintable(doc.toJson(QJsonDocument::Compact));
this->waitingCommands ++;

View file

@ -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
}
}
}

View file

@ -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"
}
}
}
}
}
}
}

View file

@ -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
}
}

View file

@ -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
}
}

View file

@ -84,6 +84,10 @@ Standort-Berechtigung verweigert!</translation>
<source>loading...</source>
<translation>laden...</translation>
</message>
<message>
<source>Automically adjust brightness</source>
<translation>Helligkeit automatisch regeln</translation>
</message>
</context>
<context>
<name>DisplayEditDialog</name>
@ -109,6 +113,14 @@ Standort-Berechtigung verweigert!</translation>
<source>Enter new display code again</source>
<translation>Geben sie den neuen Display Code erneut ein</translation>
</message>
<message>
<source>save</source>
<translation>speichern</translation>
</message>
<message>
<source>cancel</source>
<translation>abbrechen</translation>
</message>
</context>
<context>
<name>DisplayTextDelegate</name>
@ -171,6 +183,58 @@ Standort-Berechtigung verweigert!</translation>
<source>Scroll count</source>
<translation>Scrolldurchläufe</translation>
</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>
<name>main</name>