From fb61178f352378d8c70948c67d495a7036fdb6c4 Mon Sep 17 00:00:00 2001 From: MarcusStill <69536339+MarcusStill@users.noreply.github.com> Date: Thu, 3 Sep 2026 16:58:25 +0000 Subject: [PATCH] Add Windows 10/11 QSS style to PySide6 GUI - Created `files/style.qss` containing lightweight, native-looking styles for common UI elements (buttons, inputs, tabs, tables). - Updated `main.py` to load and apply the stylesheet on application startup. - Preserved existing 'Fusion' style as a base to ensure cross-platform consistency. --- files/style.qss | 85 +++++++++++++++++++++++++++++++++++++++++++++++++ main.py | 8 +++++ 2 files changed, 93 insertions(+) create mode 100644 files/style.qss diff --git a/files/style.qss b/files/style.qss new file mode 100644 index 0000000..c0f0777 --- /dev/null +++ b/files/style.qss @@ -0,0 +1,85 @@ +/* Стили в духе Windows 10/11 */ + +QMainWindow, QDialog { + background-color: #F3F3F3; + font-family: "Segoe UI", sans-serif; + font-size: 14px; + color: #000000; +} + +QWidget { + font-family: "Segoe UI", sans-serif; +} + +QPushButton { + background-color: #E1E1E1; + border: 1px solid #CCCCCC; + border-radius: 4px; + padding: 6px 12px; + font-family: "Segoe UI"; + font-size: 14px; +} + +QPushButton:hover { + background-color: #E5F1FB; + border-color: #0078D4; +} + +QPushButton:pressed { + background-color: #CCE4F7; + border-color: #005499; +} + +QPushButton:disabled { + background-color: #F0F0F0; + color: #A0A0A0; + border-color: #E0E0E0; +} + +QLineEdit, QComboBox, QDateEdit, QTimeEdit, QSpinBox { + background-color: #FFFFFF; + border: 1px solid #CCCCCC; + border-radius: 4px; + padding: 4px; + font-family: "Segoe UI"; +} + +QLineEdit:focus, QComboBox:focus, QDateEdit:focus, QTimeEdit:focus, QSpinBox:focus { + border: 1px solid #0078D4; +} + +QTabWidget::pane { + border: 1px solid #CCCCCC; + background-color: #FFFFFF; +} + +QTabBar::tab { + background-color: #F3F3F3; + border: 1px solid #CCCCCC; + padding: 8px 16px; + margin-right: 2px; +} + +QTabBar::tab:selected { + background-color: #FFFFFF; + border-bottom-color: #FFFFFF; +} + +QTabBar::tab:hover:!selected { + background-color: #E5F1FB; +} + +QTableWidget, QTableView { + background-color: #FFFFFF; + border: 1px solid #CCCCCC; + gridline-color: #E0E0E0; +} + +QHeaderView::section { + background-color: #F3F3F3; + border: none; + border-right: 1px solid #CCCCCC; + border-bottom: 1px solid #CCCCCC; + padding: 4px; + font-weight: bold; +} diff --git a/main.py b/main.py index c7f54d0..9f86bad 100644 --- a/main.py +++ b/main.py @@ -3556,6 +3556,14 @@ class Payment: if __name__ == "__main__": app = QtWidgets.QApplication(sys.argv) app.setStyle("Fusion") + + style_path = Path(__file__).parent / "files" / "style.qss" + if style_path.exists(): + with open(style_path, "r", encoding="utf-8") as f: + app.setStyleSheet(f.read()) + else: + logger.warning(f"Файл стилей не найден: {style_path}") + auth = AuthForm() auth.show() auth.ui.label_9.setText(system.database)