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 <noreply@anthropic.com>
This commit is contained in:
duan_jandClaude Fable 5 authored and duan_j committed 2026-08-17 15:34:58 +02:00
1 parent 378c25799f
commit a0baa2b54d
1 file changed
+8 -6
+8 -6
View File
@@ -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()