diff --git a/src/aare/gui/widgets/busy_overlay.py b/src/aare/gui/widgets/busy_overlay.py index e41604f6..235684f8 100644 --- a/src/aare/gui/widgets/busy_overlay.py +++ b/src/aare/gui/widgets/busy_overlay.py @@ -23,6 +23,7 @@ from aare.gui.styles import ( BUSY_YELLOW_BORDER, BUSY_YELLOW_DOT, BUSY_YELLOW_TEXT_DARK, + SHADOW, WHITE, qcolor, ) @@ -99,6 +100,30 @@ def draw_busy_badge( return bg_rect +def draw_busy_status_text( + painter: QPainter, + viewport_width: int, + viewport_height: int, + style: BusyOverlayStyle, +) -> None: + """Non-clickable busy status for the passive Axis views: solid colored + text with a 1px shadow, no badge box — the pill read as a button (same + look as the sample camera's own warning text). Same position/typeface as + draw_busy_badge so the message reads identically everywhere.""" + font = QFont() + font.setPointSize(24) + font.setBold(True) + font_metrics = QFontMetrics(font) + painter.setFont(font) + + x = (viewport_width - font_metrics.horizontalAdvance(style.text)) // 2 + baseline = int(viewport_height * 0.68) + font_metrics.ascent() // 2 + painter.setPen(QPen(qcolor(SHADOW, 200))) + painter.drawText(QPoint(x + 1, baseline + 1), style.text) + painter.setPen(QPen(qcolor(style.badge_bg))) + painter.drawText(QPoint(x, baseline), style.text) + + def build_busy_overlay_style( *, is_busy: bool, diff --git a/src/aare/gui/widgets/video_image.py b/src/aare/gui/widgets/video_image.py index bfbb52af..263433a5 100644 --- a/src/aare/gui/widgets/video_image.py +++ b/src/aare/gui/widgets/video_image.py @@ -2,7 +2,7 @@ from PySide6.QtCore import QRectF, Qt, Slot from PySide6.QtGui import QImage, QPainter, QPixmap from PySide6.QtWidgets import QGraphicsPixmapItem, QGraphicsScene, QGraphicsView -from aare.gui.widgets.busy_overlay import BusyOverlayStyle, draw_busy_badge +from aare.gui.widgets.busy_overlay import BusyOverlayStyle, draw_busy_status_text class VideoGraphicsView(QGraphicsView): @@ -114,9 +114,9 @@ class VideoGraphicsView(QGraphicsView): painter.save() painter.resetTransform() painter.setRenderHint(QPainter.RenderHint.Antialiasing, True) - # Shared renderer with the sample camera, so every view shows the - # identical badge (this view used to draw its own dot+text variant). - draw_busy_badge( + # Plain shadowed text like the sample camera's warnings, not the + # badge pill: these views are passive and the pill read as a button. + draw_busy_status_text( painter, self.viewport().width(), self.viewport().height(), self._busy_overlay_style ) painter.restore()