Update icons in the GUI

This commit is contained in:
Veronica Berglyd Olsen
2025-01-07 19:19:11 +01:00
parent 8a671dee59
commit b97844512a
25 changed files with 225 additions and 189 deletions
+7 -4
View File
@@ -164,18 +164,21 @@ class NDoubleSpinBox(QDoubleSpinBox):
class NIconToolButton(QToolButton):
def __init__(self, parent: QWidget, iconSize: QSize, icon: str | None = None) -> None:
def __init__(
self, parent: QWidget, iconSize: QSize,
icon: str | None = None, color: str | None = None
) -> None:
super().__init__(parent=parent)
self.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonIconOnly)
self.setIconSize(iconSize)
self.setPopupMode(QToolButton.ToolButtonPopupMode.InstantPopup)
if icon:
self.setThemeIcon(icon)
self.setThemeIcon(icon, color)
return
def setThemeIcon(self, iconKey: str) -> None:
def setThemeIcon(self, iconKey: str, color: str | None = None) -> None:
"""Set an icon from the current theme."""
self.setIcon(SHARED.theme.getIcon(iconKey))
self.setIcon(SHARED.theme.getIcon(iconKey, color))
return