Add theme update handling to manuscript build settings
This commit is contained in:
@@ -72,6 +72,9 @@ class NPagedSideBar(QToolBar):
|
||||
def setLabelColor(self, color: QColor) -> None:
|
||||
"""Set the text color for the labels."""
|
||||
self._labelCol = color
|
||||
for widget in self.children():
|
||||
if isinstance(widget, _NPagedToolLabel):
|
||||
widget.setTextColor(color)
|
||||
|
||||
def addLabel(self, text: str) -> None:
|
||||
"""Add a new label to the toolbar."""
|
||||
@@ -188,6 +191,10 @@ class _NPagedToolLabel(QLabel):
|
||||
|
||||
self._textCol = textColor or self.palette().text().color()
|
||||
|
||||
def setTextColor(self, textColor: QColor | None = None) -> None:
|
||||
"""Set a new text colour."""
|
||||
self._textCol = textColor or self.palette().text().color()
|
||||
|
||||
def paintEvent(self, event: QPaintEvent) -> None:
|
||||
"""Overload the paint event to draw a simple, left aligned text
|
||||
label that matches the button style.
|
||||
|
||||
Reference in New Issue
Block a user