style: move widget colors to the shared palette

Same mechanical swap for the widgets and the tutorial manager: painter
QColors go through qcolor(), inline QSS literals become palette
constants (baton dialog, busy overlay, status bar, camera overlays,
splash screen, numeric inputs).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-07 10:19:28 +02:00
co-authored by Claude Fable 5
parent 86b3f56690
commit ae7bb02a9a
14 changed files with 361 additions and 256 deletions
+17 -8
View File
@@ -15,10 +15,19 @@ from PySide6.QtCore import (
QTimer,
Signal,
)
from PySide6.QtGui import QColor, QPainter, QPen
from PySide6.QtGui import QPainter, QPen
from PySide6.QtWidgets import QLabel, QPushButton, QWidget
from aare.gui.constants import LOGGER_NAME
from aare.gui.styles import (
DEFAULT_TEXT,
NOTE_TEXT,
SHADOW,
TUTORIAL_BORDER,
TUTORIAL_HIGHLIGHT,
WHITE,
qcolor,
)
from aare.gui.tutorials.tutorial_models import (
StepFlow,
StepStatus,
@@ -95,11 +104,11 @@ class TutorialOverlay(QWidget):
self.anim.valueChanged.connect(self.update)
self.callout = QLabel(self)
self.callout.setStyleSheet("""
background: white;
color: black;
self.callout.setStyleSheet(f"""
background: {WHITE};
color: {DEFAULT_TEXT};
padding: 16px;
border: 2px solid #555;
border: 2px solid {TUTORIAL_BORDER};
border-radius: 10px;
font-size: 16px;
""")
@@ -185,10 +194,10 @@ class TutorialOverlay(QWidget):
def paintEvent(self, event) -> None:
painter = QPainter(self)
painter.fillRect(self.rect(), QColor(0, 0, 0, int(150 * self.opacity)))
painter.fillRect(self.rect(), qcolor(SHADOW, int(150 * self.opacity)))
if self.current_rect.isValid():
pen = QPen(Qt.yellow, 4)
pen = QPen(qcolor(TUTORIAL_HIGHLIGHT), 4)
painter.setPen(pen)
painter.setBrush(Qt.NoBrush)
painter.drawRoundedRect(self.current_rect, 8, 8)
@@ -219,7 +228,7 @@ class TutorialOverlay(QWidget):
if view.body.strip():
text_parts.append(view.body)
if view.hint:
text_parts.append(f"<span style='color:#555;'><i>{view.hint}</i></span>")
text_parts.append(f"<span style='color:{NOTE_TEXT};'><i>{view.hint}</i></span>")
self.callout.setText("<br><br>".join(text_parts))
self.callout.setMaximumWidth(460)