diff --git a/files/style.qss b/files/style.qss new file mode 100644 index 0000000..31b0f1d --- /dev/null +++ b/files/style.qss @@ -0,0 +1,188 @@ +/* + * Windows 10/11 Flat Aesthetic QSS for PySide6 + * Accent Color: #0078D4 + * Font: Segoe UI, sans-serif + */ + +QWidget { + font-family: "Segoe UI", "sans-serif"; + font-size: 14px; + color: #000000; + background-color: #F3F3F3; +} + +QDialog { + background-color: #FFFFFF; +} + +QMainWindow { + background-color: #F3F3F3; +} + +/* Push Buttons */ +QPushButton { + background-color: #E1E1E1; + border: 1px solid #ADADAD; + padding: 6px 12px; + border-radius: 4px; + color: #000000; + font-weight: 500; +} + +QPushButton:hover { + background-color: #E5F1FB; + border: 1px solid #0078D4; +} + +QPushButton:pressed { + background-color: #CCE4F7; + border: 1px solid #005499; +} + +QPushButton:disabled { + background-color: #CCCCCC; + color: #888888; + border: 1px solid #BFBFBF; +} + +/* Primary/Action Button (Optional: specific classes if needed) */ +QPushButton#primaryButton { + background-color: #0078D4; + color: #FFFFFF; + border: 1px solid #0078D4; +} + +QPushButton#primaryButton:hover { + background-color: #106EBE; +} + +QPushButton#primaryButton:pressed { + background-color: #005A9E; +} + +/* Line Edits & Text Inputs */ +QLineEdit, QTextEdit, QPlainTextEdit, QSpinBox, QDoubleSpinBox, QComboBox, QDateEdit, QDateTimeEdit { + background-color: #FFFFFF; + border: 1px solid #8A8A8A; + border-radius: 4px; + padding: 4px; + color: #000000; +} + +QLineEdit:focus, QTextEdit:focus, QPlainTextEdit:focus, QSpinBox:focus, QDoubleSpinBox:focus, QComboBox:focus, QDateEdit:focus, QDateTimeEdit:focus { + border: 2px solid #0078D4; + padding: 3px; /* Adjust padding to compensate for thicker border */ +} + +QLineEdit:disabled, QTextEdit:disabled, QComboBox:disabled, QDateEdit:disabled { + background-color: #F0F0F0; + color: #A0A0A0; + border: 1px solid #CCCCCC; +} + +/* ComboBox Dropdown */ +QComboBox::drop-down { + subcontrol-origin: padding; + subcontrol-position: top right; + width: 20px; + border-left-width: 1px; + border-left-color: darkgray; + border-left-style: solid; + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; + background-color: #E1E1E1; +} + +QComboBox::drop-down:hover { + background-color: #E5F1FB; +} + +QComboBox::down-arrow { + image: none; /* Can use custom SVG here if desired, but default is usually fine in Fusion */ +} + +/* Tables */ +QTableWidget, QTableView { + background-color: #FFFFFF; + alternate-background-color: #F9F9F9; + border: 1px solid #D0D0D0; + gridline-color: #E0E0E0; + selection-background-color: #0078D4; + selection-color: #FFFFFF; +} + +QHeaderView::section { + background-color: #F0F0F0; + color: #333333; + padding: 4px; + border: 1px solid #D0D0D0; + font-weight: 600; +} + +/* Tabs */ +QTabWidget::pane { + border: 1px solid #D0D0D0; + background-color: #FFFFFF; +} + +QTabBar::tab { + background-color: #E1E1E1; + color: #000000; + border: 1px solid #D0D0D0; + border-bottom-color: #D0D0D0; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + padding: 6px 12px; + margin-right: 2px; +} + +QTabBar::tab:hover { + background-color: #E5F1FB; +} + +QTabBar::tab:selected { + background-color: #FFFFFF; + border-bottom-color: #FFFFFF; + color: #0078D4; + font-weight: bold; +} + +/* Group Boxes */ +QGroupBox { + border: 1px solid #D0D0D0; + border-radius: 4px; + margin-top: 10px; + font-weight: 600; +} + +QGroupBox::title { + subcontrol-origin: margin; + subcontrol-position: top left; + padding: 0 3px; + color: #0078D4; +} + +/* Checkboxes and Radio Buttons */ +/* Note: Not overriding ::indicator as requested to keep native rendering */ +QCheckBox, QRadioButton { + spacing: 5px; + color: #000000; +} + +QCheckBox:disabled, QRadioButton:disabled { + color: #A0A0A0; +} + +/* Progress Bar */ +QProgressBar { + border: 1px solid #8A8A8A; + border-radius: 4px; + text-align: center; + color: #000000; + background-color: #E1E1E1; +} + +QProgressBar::chunk { + background-color: #0078D4; + border-radius: 2px; +} diff --git a/main.py b/main.py index c7f54d0..c71499d 100644 --- a/main.py +++ b/main.py @@ -3556,6 +3556,18 @@ class Payment: if __name__ == "__main__": app = QtWidgets.QApplication(sys.argv) app.setStyle("Fusion") + + # Load and apply modern Windows 10/11 QSS style + style_path = Path(__file__).parent / "files" / "style.qss" + try: + if style_path.exists(): + with open(style_path, "r", encoding="utf-8") as f: + app.setStyleSheet(f.read()) + else: + logger.warning(f"Stylesheet not found at {style_path}") + except Exception as e: + logger.error(f"Failed to load stylesheet: {e}") + auth = AuthForm() auth.show() auth.ui.label_9.setText(system.database) diff --git a/ui_modernization.patch b/ui_modernization.patch new file mode 100644 index 0000000..0c27b49 --- /dev/null +++ b/ui_modernization.patch @@ -0,0 +1,217 @@ +diff --git a/files/style.qss b/files/style.qss +new file mode 100644 +index 0000000..1535f17 +--- /dev/null ++++ b/files/style.qss +@@ -0,0 +1,188 @@ ++/* ++ * Windows 10/11 Flat Aesthetic QSS for PySide6 ++ * Accent Color: #0078D4 ++ * Font: Segoe UI, sans-serif ++ */ ++ ++QWidget { ++ font-family: "Segoe UI", "sans-serif"; ++ font-size: 14px; ++ color: #000000; ++ background-color: #F3F3F3; ++} ++ ++QDialog { ++ background-color: #FFFFFF; ++} ++ ++QMainWindow { ++ background-color: #F3F3F3; ++} ++ ++/* Push Buttons */ ++QPushButton { ++ background-color: #E1E1E1; ++ border: 1px solid #ADADAD; ++ padding: 6px 12px; ++ border-radius: 4px; ++ color: #000000; ++ font-weight: 500; ++} ++ ++QPushButton:hover { ++ background-color: #E5F1FB; ++ border: 1px solid #0078D4; ++} ++ ++QPushButton:pressed { ++ background-color: #CCE4F7; ++ border: 1px solid #005499; ++} ++ ++QPushButton:disabled { ++ background-color: #CCCCCC; ++ color: #888888; ++ border: 1px solid #BFBFBF; ++} ++ ++/* Primary/Action Button (Optional: specific classes if needed) */ ++QPushButton#primaryButton { ++ background-color: #0078D4; ++ color: #FFFFFF; ++ border: 1px solid #0078D4; ++} ++ ++QPushButton#primaryButton:hover { ++ background-color: #106EBE; ++} ++ ++QPushButton#primaryButton:pressed { ++ background-color: #005A9E; ++} ++ ++/* Line Edits & Text Inputs */ ++QLineEdit, QTextEdit, QPlainTextEdit, QSpinBox, QDoubleSpinBox, QComboBox, QDateEdit, QDateTimeEdit { ++ background-color: #FFFFFF; ++ border: 1px solid #8A8A8A; ++ border-radius: 4px; ++ padding: 4px; ++ color: #000000; ++} ++ ++QLineEdit:focus, QTextEdit:focus, QPlainTextEdit:focus, QSpinBox:focus, QDoubleSpinBox:focus, QComboBox:focus, QDateEdit:focus, QDateTimeEdit:focus { ++ border: 2px solid #0078D4; ++ padding: 3px; /* Adjust padding to compensate for thicker border */ ++} ++ ++QLineEdit:disabled, QTextEdit:disabled, QComboBox:disabled, QDateEdit:disabled { ++ background-color: #F0F0F0; ++ color: #A0A0A0; ++ border: 1px solid #CCCCCC; ++} ++ ++/* ComboBox Dropdown */ ++QComboBox::drop-down { ++ subcontrol-origin: padding; ++ subcontrol-position: top right; ++ width: 20px; ++ border-left-width: 1px; ++ border-left-color: darkgray; ++ border-left-style: solid; ++ border-top-right-radius: 4px; ++ border-bottom-right-radius: 4px; ++ background-color: #E1E1E1; ++} ++ ++QComboBox::drop-down:hover { ++ background-color: #E5F1FB; ++} ++ ++QComboBox::down-arrow { ++ image: none; /* Can use custom SVG here if desired, but default is usually fine in Fusion */ ++} ++ ++/* Tables */ ++QTableWidget, QTableView { ++ background-color: #FFFFFF; ++ alternate-background-color: #F9F9F9; ++ border: 1px solid #D0D0D0; ++ gridline-color: #E0E0E0; ++ selection-background-color: #0078D4; ++ selection-color: #FFFFFF; ++} ++ ++QHeaderView::section { ++ background-color: #F0F0F0; ++ color: #333333; ++ padding: 4px; ++ border: 1px solid #D0D0D0; ++ font-weight: 600; ++} ++ ++/* Tabs */ ++QTabWidget::pane { ++ border: 1px solid #D0D0D0; ++ background-color: #FFFFFF; ++} ++ ++QTabBar::tab { ++ background-color: #E1E1E1; ++ color: #000000; ++ border: 1px solid #D0D0D0; ++ border-bottom-color: #D0D0D0; ++ border-top-left-radius: 4px; ++ border-top-right-radius: 4px; ++ padding: 6px 12px; ++ margin-right: 2px; ++} ++ ++QTabBar::tab:hover { ++ background-color: #E5F1FB; ++} ++ ++QTabBar::tab:selected { ++ background-color: #FFFFFF; ++ border-bottom-color: #FFFFFF; ++ color: #0078D4; ++ font-weight: bold; ++} ++ ++/* Group Boxes */ ++QGroupBox { ++ border: 1px solid #D0D0D0; ++ border-radius: 4px; ++ margin-top: 10px; ++ font-weight: 600; ++} ++ ++QGroupBox::title { ++ subcontrol-origin: margin; ++ subcontrol-position: top left; ++ padding: 0 3px; ++ color: #0078D4; ++} ++ ++/* Checkboxes and Radio Buttons */ ++/* Note: Not overriding ::indicator as requested to keep native rendering */ ++QCheckBox, QRadioButton { ++ spacing: 5px; ++ color: #000000; ++} ++ ++QCheckBox:disabled, QRadioButton:disabled { ++ color: #A0A0A0; ++} ++ ++/* Progress Bar */ ++QProgressBar { ++ border: 1px solid #8A8A8A; ++ border-radius: 4px; ++ text-align: center; ++ color: #000000; ++ background-color: #E1E1E1; ++} ++ ++QProgressBar::chunk { ++ background-color: #0078D4; ++ border-radius: 2px; ++} +diff --git a/main.py b/main.py +index c7f54d0..29d065e 100644 +--- a/main.py ++++ b/main.py +@@ -3556,6 +3556,18 @@ class Payment: + if __name__ == "__main__": + app = QtWidgets.QApplication(sys.argv) + app.setStyle("Fusion") ++ ++ # Load and apply modern Windows 10/11 QSS style ++ style_path = Path(__file__).parent / "files" / "style.qss" ++ try: ++ if style_path.exists(): ++ with open(style_path, "r", encoding="utf-8") as f: ++ app.setStyleSheet(f.read()) ++ else: ++ logger.warning(f"Stylesheet not found at {style_path}") ++ except Exception as e: ++ logger.error(f"Failed to load stylesheet: {e}") ++ + auth = AuthForm() + auth.show() + auth.ui.label_9.setText(system.database)