Use Color and Colour consistently in the code

This commit is contained in:
Veronica Berglyd Olsen
2025-01-22 00:42:45 +01:00
parent 41a32b4fe9
commit 23398f2f8a
18 changed files with 106 additions and 105 deletions
+3 -3
View File
@@ -101,7 +101,7 @@ class NScrollableForm(QScrollArea):
self._indent = 12
self._sections: dict[int, QLabel] = {}
self._editable: dict[str, NColourLabel] = {}
self._editable: dict[str, NColorLabel] = {}
self._index: dict[str, QWidget] = {}
self._layout = QVBoxLayout()
@@ -216,7 +216,7 @@ class NScrollableForm(QScrollArea):
qLabel.setBuddy(qWidget)
if helpText:
qHelp = NColourLabel(
qHelp = NColorLabel(
str(helpText), self, color=self._helpCol,
scale=self._fontScale, wrap=True, indent=self._indent
)
@@ -257,7 +257,7 @@ class NScrollableForm(QScrollArea):
return
class NColourLabel(QLabel):
class NColorLabel(QLabel):
"""Extension: A Coloured Label
A custom widget that draws a label in a specific colour, and
+5 -3
View File
@@ -56,7 +56,7 @@ class NProgressCircle(QProgressBar):
self._cRect = QRect(point, point, size - 2*point, size - 2*point)
self._dPen = QPen(QtTransparent)
self._dBrush = QBrush(QtTransparent)
self.setColours(
self.setColors(
track=self.palette().alternateBase().color(),
bar=self.palette().highlight().color(),
text=self.palette().text().color()
@@ -66,8 +66,10 @@ class NProgressCircle(QProgressBar):
self.setFixedHeight(size)
return
def setColours(self, back: QColor | None = None, track: QColor | None = None,
bar: QColor | None = None, text: QColor | None = None) -> None:
def setColors(
self, back: QColor | None = None, track: QColor | None = None,
bar: QColor | None = None, text: QColor | None = None
) -> None:
"""Set the colours of the widget."""
if isinstance(back, QColor):
self._dPen = QPen(back)