From 447767f7de2bace666beac2d0501118947922f1a Mon Sep 17 00:00:00 2001 From: appleb_m Date: Mon, 8 Jun 2026 13:42:10 +0200 Subject: [PATCH] camer_image - busy is now middle/botom of screen. To be adjusted further. Can udno this very easyily --- src/aare/gui/widgets/camera_image.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/aare/gui/widgets/camera_image.py b/src/aare/gui/widgets/camera_image.py index b7f570b8..0300ae64 100644 --- a/src/aare/gui/widgets/camera_image.py +++ b/src/aare/gui/widgets/camera_image.py @@ -242,21 +242,31 @@ class SampleCameraImageLabel(QGraphicsView): font_metrics = QFontMetrics(font) text_rect = font_metrics.boundingRect(text) - position_x = 50 - position_y = 50 + padding_x = 20 + padding_y = 14 + bg_width = text_rect.width() + 2 * padding_x + bg_height = text_rect.height() + 2 * padding_y + + viewport_width = self.viewport().width() + viewport_height = self.viewport().height() + + position_x = int((viewport_width - bg_width) / 2) + position_y = int(viewport_height * 0.68 - bg_height / 2) - padding = 20 bg_rect = QRect( - position_x - padding, - position_y - padding, - text_rect.width() + 2 * padding, - text_rect.height() + 2 * padding + position_x, + position_y, + bg_width, + bg_height ) painter.drawRoundedRect(bg_rect, 10, 10) painter.setPen(QPen(QColor(255, 255, 255), 2, Qt.PenStyle.SolidLine)) - text_pos = QPoint(position_x, position_y + font_metrics.ascent()) + text_pos = QPoint( + position_x + padding_x, + position_y + padding_y + font_metrics.ascent() + ) painter.drawText(text_pos, text) painter.restore()