From 4ea803ed1ba1aa8c3e25a286cf5e0fa3ea3f3136 Mon Sep 17 00:00:00 2001 From: MarcusStill <69536339+MarcusStill@users.noreply.github.com> Date: Sun, 23 Aug 2026 16:53:20 +0000 Subject: [PATCH] feat: Modernize PySide6 UI to Windows 10/11 style Applies a native Qt StyleSheet (QSS) and Fusion style to mimic Windows 10/11 UI, matching user requirements without adding heavy external dependencies. It strictly preserves standard QCheckBox and QRadioButton behavior. --- files/style.qss | 158 ++++++++++++++++++++++++++++++++++++++++++++++++ main.py | 7 +++ 2 files changed, 165 insertions(+) create mode 100644 files/style.qss diff --git a/files/style.qss b/files/style.qss new file mode 100644 index 0000000..0fc646c --- /dev/null +++ b/files/style.qss @@ -0,0 +1,158 @@ +/* style.qss - Windows 10/11 Modern Theme */ + +QWidget { + font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif; + font-size: 14px; + background-color: #f3f3f3; + color: #333333; +} + +QMainWindow, QDialog { + background-color: #ffffff; +} + +QPushButton { + background-color: #0078D4; + color: white; + border: 1px solid #0078D4; + border-radius: 4px; + padding: 6px 16px; + min-height: 20px; +} + +QPushButton:hover { + background-color: #106EBE; + border: 1px solid #106EBE; +} + +QPushButton:pressed { + background-color: #005A9E; + border: 1px solid #005A9E; +} + +QPushButton:disabled { + background-color: #cccccc; + color: #666666; + border: 1px solid #cccccc; +} + +QLineEdit, QTextEdit, QComboBox, QDateEdit, QSpinBox, QDoubleSpinBox { + background-color: #ffffff; + border: 1px solid #cccccc; + border-radius: 4px; + padding: 4px 8px; + color: #333333; + selection-background-color: #0078D4; +} + +QLineEdit:focus, QTextEdit:focus, QComboBox:focus, QDateEdit:focus, QSpinBox:focus, QDoubleSpinBox:focus { + border: 1px solid #0078D4; +} + +QComboBox::drop-down { + border: none; + width: 20px; +} + +QTableWidget, QTableView { + background-color: #ffffff; + alternate-background-color: #f9f9f9; + border: 1px solid #cccccc; + gridline-color: #e0e0e0; + selection-background-color: #0078D4; + selection-color: white; +} + +QHeaderView::section { + background-color: #f0f0f0; + color: #333333; + border: none; + border-right: 1px solid #cccccc; + border-bottom: 1px solid #cccccc; + padding: 4px; + font-weight: bold; +} + +QTabWidget::pane { + border: 1px solid #cccccc; + background-color: #ffffff; +} + +QTabBar::tab { + background-color: #f0f0f0; + color: #333333; + border: 1px solid #cccccc; + border-bottom: none; + padding: 6px 16px; + margin-right: 2px; +} + +QTabBar::tab:selected { + background-color: #ffffff; + color: #0078D4; + border-top: 2px solid #0078D4; +} + +QTabBar::tab:hover:!selected { + background-color: #e5e5e5; +} + +QGroupBox { + border: 1px solid #cccccc; + border-radius: 4px; + margin-top: 10px; + padding-top: 10px; +} + +QGroupBox::title { + subcontrol-origin: margin; + subcontrol-position: top left; + padding: 0 3px; + color: #0078D4; +} + +QScrollBar:vertical { + border: none; + background: #f3f3f3; + width: 12px; + margin: 0px 0px 0px 0px; +} + +QScrollBar::handle:vertical { + background: #cdcdcd; + min-height: 20px; + border-radius: 6px; +} + +QScrollBar::handle:vertical:hover { + background: #a6a6a6; +} + +QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical { + border: none; + background: none; + height: 0px; +} + +QScrollBar:horizontal { + border: none; + background: #f3f3f3; + height: 12px; + margin: 0px 0px 0px 0px; +} + +QScrollBar::handle:horizontal { + background: #cdcdcd; + min-width: 20px; + border-radius: 6px; +} + +QScrollBar::handle:horizontal:hover { + background: #a6a6a6; +} + +QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal { + border: none; + background: none; + width: 0px; +} diff --git a/main.py b/main.py index c7f54d0..0bbf2f7 100644 --- a/main.py +++ b/main.py @@ -3556,6 +3556,13 @@ class Payment: if __name__ == "__main__": app = QtWidgets.QApplication(sys.argv) app.setStyle("Fusion") + + # Apply modern Windows 10/11 QSS style + style_path = Path(__file__).parent / "files" / "style.qss" + if style_path.exists(): + with open(style_path, "r", encoding="utf-8") as style_file: + app.setStyleSheet(style_file.read()) + auth = AuthForm() auth.show() auth.ui.label_9.setText(system.database)