3aca43b372
There was no icon system at all. Transport buttons called QStyle.standardIcon(SP_MediaPlay), which returns the platform theme's dark monochrome glyph -- painted onto the app's saturated red buttons at a fixed 36px with no text, that is the black square. Everything else called an icon was an emoji baked into en.json, which is tofu wherever the emoji font is missing. Qt stylesheets cannot recolour a QIcon, so the colour is an argument to the new helper; that is the whole fix. The SVGs are drawn here rather than vendored, which keeps a third-party licence out of the tree, and they live in the module rather than as asset files, which keeps them out of package-data and safe in a frozen build. Tooltips were the other half: three widgets in the entire application had one and nothing set an accessible name. Filling that in at the call sites would have meant editing well over a hundred of them, most in upstream-owned files. Instead one application-level event filter handles QEvent.Polish, which Qt sends to every widget once before it is shown -- so it also reaches dialogs built by upstream code, and survives the next merge. It maps placeholder emoji to icons, fills empty tooltips from the button text, and logs icon-only buttons that still have none so the gaps are findable. StyleSheet.MAIN styles the window, inputs, buttons and tables and nothing else, so the main tab bar, combos, sliders, lists, menus, splitters, tooltips and the horizontal scrollbar fell through to the platform style. EXTRA_QSS covers them, in a fork-owned module appended at the one application site. SmoothTabWidget names its frame "tabContent" with the comment "We draw border on content instead" -- that rule existed only inside two dialogs, and now exists for the main window too. Two corrections to rules that were already there: the pressed style changed the padding, shifting every label two pixels and clipping fixed-width icon buttons, and checkboxes were fully rounded, which reads as a radio button rather than an on/off toggle. Verified by screenshot on the real display: tab bar, buttons, combo carets and checkboxes all render as intended, and all 35 icons rasterise non-empty. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
439 lines
13 KiB
Python
439 lines
13 KiB
Python
|
|
class StyleSheet:
|
|
MAIN = """
|
|
QMainWindow {
|
|
background-color: #15181b;
|
|
}
|
|
QWidget {
|
|
background-color: #15181b;
|
|
color: #ffffff;
|
|
}
|
|
QLineEdit {
|
|
padding: 5px 15px;
|
|
border: 2px solid #2a2d2e;
|
|
border-radius: 6px;
|
|
background-color: #1b2021;
|
|
color: #ffffff;
|
|
font-size: 13px;
|
|
}
|
|
QLineEdit:focus {
|
|
border-color: #ff6b6b;
|
|
}
|
|
QPushButton {
|
|
padding: 8px 15px;
|
|
background-color: #c90000;
|
|
border: none;
|
|
border-radius: 4px;
|
|
color: white;
|
|
font-weight: bold;
|
|
}
|
|
QPushButton:hover {
|
|
background-color: #a50000;
|
|
}
|
|
QPushButton:pressed {
|
|
background-color: #800000;
|
|
padding: 10px 13px 6px 17px;
|
|
}
|
|
QPushButton:disabled {
|
|
background-color: #3d3d3d;
|
|
color: #888888;
|
|
}
|
|
QTableWidget {
|
|
border: 2px solid #1b2021;
|
|
border-radius: 4px;
|
|
background-color: #1b2021;
|
|
gridline-color: #1b2021;
|
|
}
|
|
QHeaderView::section {
|
|
background-color: #15181b;
|
|
padding: 5px;
|
|
border: 1px solid #1b2021;
|
|
color: #ffffff;
|
|
}
|
|
QProgressBar {
|
|
border: 2px solid #1b2021;
|
|
border-radius: 4px;
|
|
text-align: center;
|
|
color: white;
|
|
}
|
|
QProgressBar::chunk {
|
|
background-color: #c90000;
|
|
border-radius: 2px;
|
|
}
|
|
QLabel {
|
|
color: #ffffff;
|
|
}
|
|
/* Style for filter buttons */
|
|
QPushButton.filter-btn {
|
|
background-color: #1b2021;
|
|
padding: 5px 10px;
|
|
margin: 0 5px;
|
|
}
|
|
QPushButton.filter-btn:checked {
|
|
background-color: #c90000;
|
|
}
|
|
QPushButton.filter-btn:hover {
|
|
background-color: #444444;
|
|
}
|
|
QPushButton.filter-btn:checked:hover {
|
|
background-color: #a50000;
|
|
}
|
|
/* Modern Scrollbar Styling */
|
|
QScrollBar:vertical {
|
|
border: none;
|
|
background: #15181b;
|
|
width: 14px;
|
|
margin: 15px 0 15px 0;
|
|
border-radius: 7px;
|
|
}
|
|
QScrollBar::handle:vertical {
|
|
background: #404040;
|
|
min-height: 30px;
|
|
border-radius: 7px;
|
|
}
|
|
QScrollBar::handle:vertical:hover {
|
|
background: #505050;
|
|
}
|
|
QScrollBar::sub-line:vertical {
|
|
border: none;
|
|
background: #15181b;
|
|
height: 15px;
|
|
border-top-left-radius: 7px;
|
|
border-top-right-radius: 7px;
|
|
subcontrol-position: top;
|
|
subcontrol-origin: margin;
|
|
}
|
|
QScrollBar::add-line:vertical {
|
|
border: none;
|
|
background: #15181b;
|
|
height: 15px;
|
|
border-bottom-left-radius: 7px;
|
|
border-bottom-right-radius: 7px;
|
|
subcontrol-position: bottom;
|
|
subcontrol-origin: margin;
|
|
}
|
|
QScrollBar::sub-line:vertical:hover,
|
|
QScrollBar::add-line:vertical:hover {
|
|
background: #404040;
|
|
}
|
|
QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical {
|
|
background: none;
|
|
width: 0;
|
|
height: 0;
|
|
}
|
|
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
|
|
background: none;
|
|
}
|
|
"""
|
|
|
|
PASTE_BUTTON = """
|
|
QPushButton {
|
|
padding: 9px 20px;
|
|
background-color: #1b2021;
|
|
border: 2px solid #2a2d2e;
|
|
border-radius: 5px;
|
|
color: #ffffff;
|
|
font-weight: 600;
|
|
font-size: 13px;
|
|
}
|
|
QPushButton:hover {
|
|
background-color: #252829;
|
|
border-color: #3a3d3e;
|
|
}
|
|
QPushButton:pressed {
|
|
background-color: #1a1d1e;
|
|
padding: 11px 18px 7px 22px;
|
|
}
|
|
"""
|
|
|
|
ANALYZE_BUTTON = """
|
|
QPushButton {
|
|
padding: 9px 20px;
|
|
background-color: #c90000;
|
|
border: none;
|
|
border-radius: 5px;
|
|
color: white;
|
|
font-weight: 600;
|
|
font-size: 13px;
|
|
}
|
|
QPushButton:hover {
|
|
background-color: #a50000;
|
|
}
|
|
QPushButton:pressed {
|
|
background-color: #800000;
|
|
padding: 11px 18px 7px 22px;
|
|
}
|
|
QPushButton:disabled {
|
|
background-color: #3d3d3d;
|
|
color: #888888;
|
|
}
|
|
"""
|
|
|
|
PLAYLIST_BUTTON = """
|
|
QPushButton {
|
|
padding: 6px 12px;
|
|
background-color: #1d1e22;
|
|
border: 1px solid #c90000;
|
|
border-radius: 4px;
|
|
color: white;
|
|
font-weight: normal;
|
|
text-align: left;
|
|
padding-left: 10px;
|
|
}
|
|
QPushButton:hover {
|
|
background-color: #2a2d36;
|
|
border-color: #a50000;
|
|
}
|
|
QPushButton:pressed {
|
|
background-color: #1d1e22;
|
|
padding: 8px 10px 4px 12px;
|
|
}
|
|
"""
|
|
|
|
FORMAT_TOGGLE_BUTTON = """
|
|
QPushButton {
|
|
padding: 8px 15px;
|
|
background-color: #1d1e22;
|
|
border: none;
|
|
border-radius: 4px;
|
|
color: white;
|
|
font-weight: bold;
|
|
}
|
|
QPushButton:checked {
|
|
background-color: #c90000;
|
|
}
|
|
QPushButton:hover {
|
|
background-color: #2a2d36;
|
|
}
|
|
QPushButton:checked:hover {
|
|
background-color: #a50000;
|
|
}
|
|
QPushButton:pressed {
|
|
background-color: #151619;
|
|
padding: 10px 13px 6px 17px;
|
|
}
|
|
QPushButton:checked:pressed {
|
|
background-color: #800000;
|
|
padding: 10px 13px 6px 17px;
|
|
}
|
|
"""
|
|
|
|
CHECKBOX = """
|
|
QCheckBox {
|
|
color: #ffffff;
|
|
padding: 5px;
|
|
margin-left: 20px;
|
|
}
|
|
/* Square, not round: a fully-rounded indicator reads as a radio
|
|
button, i.e. "one of these", when these are independent
|
|
on/off options. */
|
|
QCheckBox::indicator {
|
|
width: 16px;
|
|
height: 16px;
|
|
border-radius: 4px;
|
|
}
|
|
QCheckBox::indicator:unchecked {
|
|
border: 2px solid #666666;
|
|
background: #1d1e22;
|
|
border-radius: 4px;
|
|
}
|
|
QCheckBox::indicator:unchecked:hover {
|
|
border-color: #9aa0a6;
|
|
}
|
|
QCheckBox::indicator:checked {
|
|
border: 2px solid #c90000;
|
|
background: #c90000;
|
|
border-radius: 4px;
|
|
}
|
|
QCheckBox:disabled { color: #888888; }
|
|
QCheckBox::indicator:disabled { border-color: #555555; background: #444444; }
|
|
"""
|
|
|
|
PROGRESS_BAR = """
|
|
QProgressBar {
|
|
border: 2px solid #3d3d3d;
|
|
border-radius: 4px;
|
|
text-align: center;
|
|
color: white;
|
|
background-color: #363636;
|
|
height: 25px;
|
|
}
|
|
QProgressBar::chunk {
|
|
background-color: #ff0000;
|
|
border-radius: 2px;
|
|
}
|
|
"""
|
|
|
|
STATUS_LABEL = """
|
|
QLabel {
|
|
color: #cccccc;
|
|
font-size: 12px;
|
|
padding: 5px;
|
|
}
|
|
"""
|
|
|
|
OPEN_FOLDER_BUTTON = """
|
|
QPushButton {
|
|
background-color: #2a2d2e;
|
|
color: #cccccc;
|
|
border: 1px solid #404040;
|
|
border-radius: 5px;
|
|
font-size: 16px;
|
|
padding: 2px;
|
|
}
|
|
QPushButton:hover {
|
|
background-color: #3a3d3e;
|
|
border: 1px solid #505050;
|
|
}
|
|
QPushButton:pressed {
|
|
background-color: #1a1d1e;
|
|
padding: 4px 0px 0px 4px;
|
|
}
|
|
"""
|
|
|
|
UPDATE_DIALOG_MESSAGE = """
|
|
QLabel {
|
|
background-color: #1d1e22;
|
|
border: 1px solid #3d3d3d;
|
|
border-radius: 6px;
|
|
padding: 15px;
|
|
margin: 5px 0;
|
|
}
|
|
"""
|
|
|
|
UPDATE_DIALOG_CHANGELOG = """
|
|
QTextEdit {
|
|
background-color: #1d1e22;
|
|
border: 2px solid #3d3d3d;
|
|
border-radius: 6px;
|
|
color: #ffffff;
|
|
padding: 10px;
|
|
font-family: 'Segoe UI', Arial, sans-serif;
|
|
font-size: 12px;
|
|
line-height: 1.4;
|
|
}
|
|
QScrollBar:vertical {
|
|
border: none;
|
|
background: #1d1e22;
|
|
width: 12px;
|
|
border-radius: 6px;
|
|
}
|
|
QScrollBar::handle:vertical {
|
|
background: #404040;
|
|
min-height: 20px;
|
|
border-radius: 6px;
|
|
}
|
|
QScrollBar::handle:vertical:hover {
|
|
background: #505050;
|
|
}
|
|
"""
|
|
|
|
UPDATE_DIALOG_DOWNLOAD_BTN = """
|
|
QPushButton {
|
|
padding: 10px 20px;
|
|
background-color: #c90000;
|
|
border: none;
|
|
border-radius: 6px;
|
|
color: white;
|
|
font-weight: bold;
|
|
font-size: 13px;
|
|
min-width: 140px;
|
|
}
|
|
QPushButton:hover {
|
|
background-color: #a50000;
|
|
}
|
|
QPushButton:pressed {
|
|
background-color: #800000;
|
|
}
|
|
"""
|
|
|
|
UPDATE_DIALOG_REMIND_BTN = """
|
|
QPushButton {
|
|
padding: 10px 20px;
|
|
background-color: #3d3d3d;
|
|
border: 1px solid #555555;
|
|
border-radius: 6px;
|
|
color: white;
|
|
font-weight: bold;
|
|
font-size: 13px;
|
|
min-width: 140px;
|
|
}
|
|
QPushButton:hover {
|
|
background-color: #4d4d4d;
|
|
border-color: #666666;
|
|
}
|
|
QPushButton:pressed {
|
|
background-color: #2d2d2d;
|
|
}
|
|
"""
|
|
|
|
UPDATE_DIALOG_MAIN = """
|
|
QDialog {
|
|
background-color: #15181b;
|
|
border: 1px solid #3d3d3d;
|
|
border-radius: 8px;
|
|
}
|
|
QLabel {
|
|
color: #ffffff;
|
|
font-size: 12px;
|
|
}
|
|
"""
|
|
|
|
TIME_RANGE_BTN_ACTIVE = """
|
|
QPushButton {
|
|
padding: 8px 15px;
|
|
background-color: #c90000;
|
|
border: none;
|
|
border-radius: 4px;
|
|
color: white;
|
|
font-weight: bold;
|
|
border: 2px solid white;
|
|
}
|
|
QPushButton:hover {
|
|
background-color: #a50000;
|
|
}
|
|
"""
|
|
|
|
FILE_EXISTS_DIALOG = """
|
|
QMessageBox {
|
|
background-color: #2b2b2b;
|
|
}
|
|
QLabel {
|
|
color: #ffffff;
|
|
}
|
|
QPushButton {
|
|
padding: 8px 15px;
|
|
background-color: #ff0000;
|
|
border: none;
|
|
border-radius: 4px;
|
|
color: white;
|
|
font-weight: bold;
|
|
min-width: 80px;
|
|
}
|
|
QPushButton:hover {
|
|
background-color: #cc0000;
|
|
}
|
|
"""
|
|
|
|
SETUP_SUCCESS_DIALOG = """
|
|
QMessageBox {
|
|
background-color: #15181b;
|
|
color: #ffffff;
|
|
}
|
|
QLabel {
|
|
color: #ffffff;
|
|
}
|
|
QPushButton {
|
|
padding: 8px 15px;
|
|
background-color: #c90000;
|
|
border: none;
|
|
border-radius: 4px;
|
|
color: white;
|
|
font-weight: bold;
|
|
}
|
|
QPushButton:hover {
|
|
background-color: #a50000;
|
|
}
|
|
"""
|
|
|