Files
Button/qml/SettingsDialog.qml
T
GrigoandClaude Opus 5.5 f07e153f09 Boot splash and periodic announcement banner
Splash: resources/splash/splash.gif built into the binary, played once by
SplashOverlay over a black cover present from the first frame (no UI
flash), then fades into the UI; hides icons loading. GIF, so no
QtMultimedia/gstreamer. Toggle: splash.enabled.

Banner (InfoBanner): metro-style band that fades/slides in with a hold
pictogram; text that does not fit runs as a seamless ticker for two
rounds. Never takes touches; hidden during splash and settings. Config
section banner (enabled, text, intervalSec, showSec, position,
accentColor), editable in the web UI and on-device settings; shown once
after saving.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 10:58:16 +00:00

149 lines
4.1 KiB
QML

import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import "settings"
Dialog {
id: dlg
modal: true
title: "Настройки"
width: Math.min(720, parent ? parent.width * 0.95 : 720)
height: Math.min(560, parent ? parent.height * 0.95 : 560)
anchors.centerIn: parent
standardButtons: Dialog.Close
// BannerPage "Показать сейчас": the dialog closes, Main shows the banner.
signal bannerPreview()
readonly property color panelBg: "#161628"
readonly property color panelFg: "#ffffff"
readonly property color panelMuted: "#cccccc"
readonly property color controlBg: "#2a2a40"
palette.button: controlBg
palette.buttonText: panelFg
palette.window: panelBg
palette.windowText: panelFg
palette.text: panelFg
palette.base: "#222236"
palette.alternateBase: controlBg
palette.highlight: "#4a4a70"
palette.highlightedText: panelFg
background: Rectangle {
color: panelBg
radius: 4
}
StackView {
id: stack
anchors.fill: parent
initialItem: mainPageComp
background: Rectangle {
color: panelBg
}
}
Component {
id: mainPageComp
MainPage {
onOpenButtons: stack.push(buttonsPageComp)
onOpenLayout: stack.push(layoutPageComp)
onOpenBackground: stack.push(backgroundPageComp)
onOpenFeedback: stack.push(feedbackPageComp)
onOpenBanner: stack.push(bannerPageComp)
onOpenNetwork: stack.push(networkPageComp)
onOpenUpdate: stack.push(updatePageComp)
onChangePassword: changePwdDialog.open()
}
}
Component {
id: buttonsPageComp
ButtonsPage {
onCreateRequested: editorDialog.openForCreate()
onEditRequested: function(data) { editorDialog.openForEdit(data) }
}
}
Component { id: layoutPageComp; LayoutPage {} }
Component { id: backgroundPageComp; BackgroundPage {} }
Component { id: feedbackPageComp; FeedbackPage {} }
Component { id: networkPageComp; NetworkInfoPage {} }
Component { id: updatePageComp; UpdatePage {} }
Component {
id: bannerPageComp
BannerPage {
onPreviewRequested: {
dlg.close()
dlg.bannerPreview()
}
}
}
ButtonEditorDialog { id: editorDialog }
onClosed: {
changePwdDialog.close()
editorDialog.close()
}
Dialog {
id: changePwdDialog
modal: true
parent: Overlay.overlay
title: "Сменить пароль"
anchors.centerIn: parent
width: Math.min(420, dlg.width * 0.9)
standardButtons: Dialog.Ok | Dialog.Cancel
palette.button: dlg.controlBg
palette.buttonText: dlg.panelFg
palette.window: dlg.panelBg
palette.windowText: dlg.panelFg
palette.text: dlg.panelFg
palette.base: "#222236"
background: Rectangle {
color: dlg.panelBg
radius: 4
}
contentItem: ColumnLayout {
spacing: 8
TextField {
id: newPwdField
Layout.fillWidth: true
Layout.preferredHeight: 40
placeholderText: "Новый пароль"
onAccepted: changePwdDialog.accept()
}
Text {
id: pwdEmptyHint
Layout.fillWidth: true
visible: false
color: "red"
text: "Введите новый пароль"
}
}
onOpened: {
newPwdField.text = ""
pwdEmptyHint.visible = false
newPwdField.forceActiveFocus()
}
onAccepted: {
var p = newPwdField.text.trim()
if (p.length === 0) {
pwdEmptyHint.visible = true
Qt.callLater(changePwdDialog.open)
return
}
btnController.setPassword(p)
newPwdField.text = ""
pwdEmptyHint.visible = false
}
}
}