Add theme update handling to manuscript build settings

This commit is contained in:
Veronica Berglyd Olsen
2025-10-26 02:04:03 +01:00
parent e492c6575d
commit 8b02c95f51
6 changed files with 114 additions and 42 deletions
+7
View File
@@ -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.