Update icons in the GUI
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -94,7 +94,9 @@ class NovelSelector(QComboBox):
|
||||
self._firstHandle = None
|
||||
self.clear()
|
||||
|
||||
icon = SHARED.theme.getIcon(nwLabels.CLASS_ICON[nwItemClass.NOVEL])
|
||||
icon = SHARED.theme.getIcon(
|
||||
nwLabels.CLASS_ICON[nwItemClass.NOVEL], nwLabels.CLASS_COLOR[nwItemClass.NOVEL]
|
||||
)
|
||||
handle = self.currentData()
|
||||
for tHandle, nwItem in SHARED.project.tree.iterRoots(nwItemClass.NOVEL):
|
||||
if self._listFormat:
|
||||
|
||||
Reference in New Issue
Block a user