zapret-kvn/xray_fluent/ui/lock_dialog.py
loop-uh a7cf61a05e
All checks were successful
Windows project source guards / test (push) Successful in 36s
Prepare v0.4.79: unified theming, responsive layout, real flags
- Single source of truth for theme: theme.py tokens, FluentDialog base
  for all dialogs, setCustomStyleSheet migration, theme applied before
  window creation, SystemThemeListener for auto mode
- Responsive layout: ScrollablePage base with as-needed horizontal
  scrolling, word wrap on dashboard labels, adaptive dashboard grid,
  realistic 860x560 window minimum
- Real country flags (flagcdn PNG set) with themed border and fallback
- Active server row marked by accent stripe only (no synthesized bold)
- Subscription polish from parallel work (QR utils, http, diagnostics)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 23:21:28 +03:00

40 lines
1.4 KiB
Python

from __future__ import annotations
from PyQt6.QtWidgets import QHBoxLayout, QVBoxLayout
from qfluentwidgets import BodyLabel, PasswordLineEdit, PrimaryPushButton, PushButton, SubtitleLabel
from .fluent_dialog import FluentDialog
class PasswordDialog(FluentDialog):
def __init__(self, title: str = "Разблокировать", parent=None):
super().__init__(parent)
self.setWindowTitle(title)
self.setModal(True)
self.setMinimumWidth(360)
root = QVBoxLayout(self)
root.setContentsMargins(20, 20, 20, 20)
root.setSpacing(10)
root.addWidget(SubtitleLabel(title, self))
root.addWidget(BodyLabel("Введите мастер-пароль", self))
self.password_edit = PasswordLineEdit(self)
self.password_edit.setPlaceholderText("Пароль")
self.password_edit.returnPressed.connect(self.accept)
root.addWidget(self.password_edit)
row = QHBoxLayout()
row.addStretch(1)
self.cancel_btn = PushButton("Отмена", self)
self.ok_btn = PrimaryPushButton("OK", self)
row.addWidget(self.cancel_btn)
row.addWidget(self.ok_btn)
root.addLayout(row)
self.cancel_btn.clicked.connect(self.reject)
self.ok_btn.clicked.connect(self.accept)
def password(self) -> str:
return self.password_edit.text().strip()