Polish GUI design
This commit is contained in:
+20
-63
@@ -5,23 +5,15 @@ from __future__ import annotations
|
||||
from PyQt6.QtGui import QColor, QPalette
|
||||
from PyQt6.QtWidgets import QApplication, QStyleFactory
|
||||
|
||||
PLOT_BACKGROUND = "#0f141c"
|
||||
|
||||
_LIGHT_STYLESHEET = """
|
||||
QMainWindow, QDialog {
|
||||
background-color: #f3f6fb;
|
||||
}
|
||||
|
||||
QWidget {
|
||||
color: #1f2937;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
QGroupBox {
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #d7dee8;
|
||||
border-radius: 10px;
|
||||
margin-top: 14px;
|
||||
padding: 10px;
|
||||
border-radius: 6px;
|
||||
margin-top: 12px;
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
QGroupBox::title {
|
||||
@@ -35,11 +27,11 @@ QGroupBox::title {
|
||||
QPushButton {
|
||||
background-color: #f8fafc;
|
||||
border: 1px solid #cad4e1;
|
||||
border-radius: 8px;
|
||||
padding: 7px 12px;
|
||||
border-radius: 4px;
|
||||
padding: 3px 10px;
|
||||
}
|
||||
|
||||
QPushButton:hover {
|
||||
QPushButton:hover:enabled {
|
||||
background-color: #eef3f9;
|
||||
}
|
||||
|
||||
@@ -47,70 +39,30 @@ QPushButton:pressed {
|
||||
background-color: #e4ebf4;
|
||||
}
|
||||
|
||||
QPushButton:checked {
|
||||
QPushButton:checked, QPushButton[role="primary"] {
|
||||
background-color: #2f7ee6;
|
||||
border-color: #2f7ee6;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
QPushButton:checked:hover {
|
||||
QPushButton:checked:hover:enabled, QPushButton[role="primary"]:hover:enabled {
|
||||
background-color: #3b8bf4;
|
||||
}
|
||||
|
||||
QPushButton[role="destructive"] {
|
||||
color: #a73545;
|
||||
border-color: #cf9ba4;
|
||||
}
|
||||
|
||||
QPushButton:disabled {
|
||||
color: #98a4b3;
|
||||
background-color: #f3f5f8;
|
||||
border-color: #dde4ec;
|
||||
}
|
||||
|
||||
QPushButton#settingsToggleButton {
|
||||
min-width: 26px;
|
||||
max-width: 26px;
|
||||
padding: 6px 0px;
|
||||
border-radius: 7px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
QPushButton#sectionToggleButton {
|
||||
min-width: 84px;
|
||||
padding: 5px 10px;
|
||||
border-radius: 7px;
|
||||
}
|
||||
|
||||
QLineEdit,
|
||||
QPlainTextEdit,
|
||||
QTextEdit,
|
||||
QComboBox,
|
||||
QSpinBox,
|
||||
QDoubleSpinBox {
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #c9d4e1;
|
||||
border-radius: 7px;
|
||||
padding: 5px 8px;
|
||||
selection-background-color: #cfe3ff;
|
||||
}
|
||||
|
||||
QLineEdit:focus,
|
||||
QPlainTextEdit:focus,
|
||||
QTextEdit:focus,
|
||||
QComboBox:focus,
|
||||
QSpinBox:focus,
|
||||
QDoubleSpinBox:focus {
|
||||
border: 1px solid #2f7ee6;
|
||||
}
|
||||
|
||||
QTextEdit#runtimeLogBox {
|
||||
font-family: "DejaVu Sans Mono";
|
||||
font-size: 12px;
|
||||
padding: 6px 8px;
|
||||
color: #1f2937;
|
||||
background-color: #fbfdff;
|
||||
border-color: #c9d4e1;
|
||||
}
|
||||
|
||||
QComboBox::drop-down {
|
||||
border: none;
|
||||
width: 18px;
|
||||
}
|
||||
|
||||
QScrollArea {
|
||||
@@ -121,7 +73,6 @@ QScrollArea {
|
||||
QLabel#statusLabel {
|
||||
color: #35507a;
|
||||
font-weight: 600;
|
||||
padding: 2px 1px;
|
||||
}
|
||||
|
||||
QLabel#hintLabel {
|
||||
@@ -133,6 +84,9 @@ QLabel#hintLabel {
|
||||
def apply_light_theme(app: QApplication) -> None:
|
||||
"""Apply a minimal light theme shared by all windows."""
|
||||
app.setStyle(QStyleFactory.create("Fusion"))
|
||||
font = app.font()
|
||||
font.setPointSize(10)
|
||||
app.setFont(font)
|
||||
|
||||
palette = QPalette()
|
||||
palette.setColor(QPalette.ColorRole.Window, QColor("#f3f6fb"))
|
||||
@@ -148,5 +102,8 @@ def apply_light_theme(app: QApplication) -> None:
|
||||
palette.setColor(QPalette.ColorRole.Link, QColor("#2f7ee6"))
|
||||
palette.setColor(QPalette.ColorRole.Highlight, QColor("#2f7ee6"))
|
||||
palette.setColor(QPalette.ColorRole.HighlightedText, QColor("#ffffff"))
|
||||
for role in (QPalette.ColorRole.Text, QPalette.ColorRole.ButtonText, QPalette.ColorRole.WindowText):
|
||||
palette.setColor(QPalette.ColorGroup.Disabled, role, QColor("#98a4b3"))
|
||||
palette.setColor(QPalette.ColorGroup.Disabled, QPalette.ColorRole.Base, QColor("#f3f5f8"))
|
||||
app.setPalette(palette)
|
||||
app.setStyleSheet(_LIGHT_STYLESHEET)
|
||||
|
||||
Reference in New Issue
Block a user