added backlight and fixed outbound

This commit is contained in:
2026-07-21 09:17:48 +03:00
parent ff2b8a250e
commit 5392273794
37 changed files with 1560 additions and 76 deletions
+71 -1
View File
@@ -26,8 +26,22 @@ Item {
deviceIp = "—"
}
Component.onCompleted: refreshIp()
function refreshBrightness() {
var r = systemInfo.brightnessStatus()
if (r.ok) {
brightnessSlider.value = r.percent != null ? r.percent : 100
brightnessHint.text = "Сейчас: " + r.percent + "%" +
(r.device ? (" (" + r.device + ")") : "") +
(r.saved != null ? (" · сохранено: " + r.saved + "%") : "")
} else {
brightnessHint.text = "Подсветка недоступна: " + (r.error || "ошибка")
}
}
Component.onCompleted: {
refreshIp()
refreshBrightness()
}
Timer {
interval: 5000
running: true
@@ -101,6 +115,62 @@ Item {
onClicked: page.changePassword()
}
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: brightnessCol.implicitHeight + 16
Layout.topMargin: 8
radius: 4
color: "#2a2a40"
ColumnLayout {
id: brightnessCol
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.margins: 8
spacing: 6
Text {
Layout.fillWidth: true
text: "Яркость экрана"
color: "#ffffff"
font.pixelSize: 14
font.bold: true
}
Text {
id: brightnessHint
Layout.fillWidth: true
text: "Загрузка…"
color: "#aaaaaa"
font.pixelSize: 12
wrapMode: Text.WordWrap
}
LabeledSlider {
id: brightnessSlider
Layout.fillWidth: true
label: "Яркость %"
from: 1
to: 100
stepSize: 1
value: 100
}
SettingsButton {
Layout.fillWidth: true
text: "Применить яркость"
onClicked: {
var r = systemInfo.setBrightness(Math.round(brightnessSlider.value))
if (r.ok) {
brightnessHint.text = "Сейчас: " + r.percent + "%" +
(r.device ? (" (" + r.device + ")") : "") +
(r.saved != null ? (" · сохранено: " + r.saved + "%") : "")
} else {
brightnessHint.text = "Ошибка: " + (r.error || "неизвестно")
}
}
}
}
}
Text {
Layout.fillWidth: true
Layout.topMargin: 8