minor fixess

This commit is contained in:
2026-07-13 06:04:04 +03:00
parent e9e2cbbfec
commit ff2b8a250e
34 changed files with 712 additions and 282 deletions
+70 -7
View File
@@ -12,10 +12,34 @@ Dialog {
anchors.centerIn: parent
standardButtons: Dialog.Close
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 {
@@ -50,19 +74,58 @@ Dialog {
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
TextField {
id: newPwdField
anchors.fill: parent
placeholderText: "Новый пароль"
echoMode: TextInput.Password
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: "Новый пароль"
echoMode: TextInput.Password
onAccepted: changePwdDialog.accept()
}
Text {
id: pwdEmptyHint
Layout.fillWidth: true
visible: false
color: "red"
text: "Введите новый пароль"
}
}
onOpened: {
newPwdField.text = ""
pwdEmptyHint.visible = false
newPwdField.forceActiveFocus()
}
onAccepted: {
if (newPwdField.text.length > 0)
btnController.setPassword(newPwdField.text)
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
}
}
}