|
6 | 6 | """ |
7 | 7 |
|
8 | 8 | from PySide6.QtCore import Qt |
9 | | -from PySide6.QtGui import QDoubleValidator, QIcon, QIntValidator |
| 9 | +from PySide6.QtGui import QDoubleValidator, QIcon, QIntValidator, QPixmap |
10 | 10 | from PySide6.QtWidgets import ( |
11 | 11 | QComboBox, |
12 | 12 | QDialog, |
@@ -93,15 +93,23 @@ def get_header_title(self) -> str: |
93 | 93 |
|
94 | 94 | def _create_settings_icon(self) -> QIcon: |
95 | 95 | """Create an SVG gear icon coloured to match the current theme.""" |
96 | | - # Get theme-appropriate icon color |
97 | | - fill_color = "#f59e0b" # Default amber color for dark theme |
| 96 | + # Get theme-appropriate icon color from theme definitions |
| 97 | + fill_color = self._get_theme_icon_color() |
98 | 98 |
|
99 | 99 | svg = f""" |
100 | 100 | <svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> |
101 | 101 | <path d="M12 15.5A3.5 3.5 0 0 1 8.5 12A3.5 3.5 0 0 1 12 8.5a3.5 3.5 0 0 1 3.5 3.5a3.5 3.5 0 0 1-3.5 3.5m7.43-2.53c.04-.32.07-.64.07-.97c0-.33-.03-.66-.07-1l2.11-1.63c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.39-1.06-.73-1.69-.98l-.37-2.65A.506.506 0 0 0 14 2h-4c-.25 0-.46.18-.5.42l-.37 2.65c-.63.25-1.17.59-1.69.98l-2.49-1c-.22-.08-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64L4.57 11c-.04.34-.07.67-.07 1c0 .33.03.65.07.97l-2.11 1.66c-.19.15-.25.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1.01c.52.4 1.06.74 1.69.99l.37 2.65c.04.24.25.42.5.42h4c.25 0 .46-.18.5-.42l.37-2.65c.63-.26 1.17-.59 1.69-.99l2.49 1.01c.22.08.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.66Z" fill="{fill_color}"/> |
102 | 102 | </svg> |
103 | 103 | """ |
104 | | - return QIcon(svg) |
| 104 | + pixmap = QPixmap() |
| 105 | + pixmap.loadFromData(bytes(svg, encoding="utf-8"), "SVG") |
| 106 | + return QIcon(pixmap) |
| 107 | + |
| 108 | + def _get_theme_icon_color(self) -> str: |
| 109 | + """Get icon color from QSS theme file (Icon: #xxxxxx in Base Colors comment).""" |
| 110 | + from ..utils.theme_manager import get_theme_manager |
| 111 | + |
| 112 | + return get_theme_manager().get_theme_color("Icon") |
105 | 113 |
|
106 | 114 | def _setup_ui(self) -> None: |
107 | 115 | """Set up the UI layout.""" |
|
0 commit comments