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
+9 -2
View File
@@ -70,13 +70,20 @@ Item {
height: width
radius: width / 2
color: btnColor || "#7b007b"
// Idle: no ring. Feedback states draw the configured coloured outline.
// ColorBehavior is only enabled while in a feedback state so that on
// return to idle the colour snaps away immediately — otherwise a ~1px
// red (or green) remnant stays visible while width animates down.
border.color: status === 1 ? delegateRoot.okColor
: status === 2 ? delegateRoot.errorColor
: status === 3 ? delegateRoot.pendingColor
: Qt.lighter(btnColor || "#7b007b", 1.5)
border.width: status === 1 || status === 2 || status === 3 ? delegateRoot.feedbackWidth : 1
border.width: status === 1 || status === 2 || status === 3 ? delegateRoot.feedbackWidth : 0
Behavior on border.width { NumberAnimation { duration: 200 } }
Behavior on border.color { ColorAnimation { duration: 200 } }
Behavior on border.color {
enabled: status === 1 || status === 2 || status === 3
ColorAnimation { duration: 200 }
}
// Hold-to-activate state (0..1). Only used in "hold" trigger mode.
property real holdProgress: 0.0
+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