From a0baa2b54dde762af27be62c7c15658728e797b6 Mon Sep 17 00:00:00 2001 From: Dawn Date: Mon, 17 Aug 2026 14:20:24 +0200 Subject: [PATCH] style: help badge at center top, More link right-aligned The '?' badge sat in a corner, which drifts oddly when the view is scaled to fit; the top middle stays put and out of the sample's way. Transparency unchanged - visible enough to find, not disturbing. 'More... (F1)' moves to the overlay's right edge, reading like a dialog's action button. Co-Authored-By: Claude Fable 5 --- src/aare/gui/widgets/camera_image.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/aare/gui/widgets/camera_image.py b/src/aare/gui/widgets/camera_image.py index 88c1b5d8..cb3cde8f 100644 --- a/src/aare/gui/widgets/camera_image.py +++ b/src/aare/gui/widgets/camera_image.py @@ -1089,7 +1089,9 @@ class SampleCameraImageLabel(QGraphicsView): # ponytail: painted circle, not a real QWidget button — the overlay it # toggles is painter-drawn too, and a widget would need layout juggling. diameter = 22 - rect = QRectF(18, self.viewport().height() - diameter - 18, diameter, diameter) + # Center top, not a corner: corners drift oddly on scale-to-fit, + # the top middle stays put and stays out of the sample's way. + rect = QRectF((self.viewport().width() - diameter) / 2, 18, diameter, diameter) painter.save() painter.resetTransform() @@ -1166,15 +1168,15 @@ class SampleCameraImageLabel(QGraphicsView): painter.drawText(QPointF(bg_rect.left() + padding, y + fm.ascent()), entry) y += line_height - # Trailing link to the full F1 dialog; underlined so it reads as clickable. + # Trailing link to the full F1 dialog; underlined so it reads as + # clickable, right-aligned like a dialog's action button. link_font = QFont(font) link_font.setUnderline(True) painter.setFont(link_font) painter.setPen(QPen(qcolor(LEGEND_TEXT), 1)) - painter.drawText(QPointF(bg_rect.left() + padding, y + fm.ascent()), more_text) - self._help_more_rect = QRectF( - bg_rect.left() + padding, y, fm.horizontalAdvance(more_text), line_height - ) + more_x = bg_rect.right() - padding - fm.horizontalAdvance(more_text) + painter.drawText(QPointF(more_x, y + fm.ascent()), more_text) + self._help_more_rect = QRectF(more_x, y, fm.horizontalAdvance(more_text), line_height) painter.restore()