From ed42738693e6033ebeb5877c15bb842ed52e915e Mon Sep 17 00:00:00 2001 From: Dawn Date: Fri, 7 Aug 2026 17:35:58 +0200 Subject: [PATCH] style: clear the two portrait-mode diff-gate violations The sample-name labels are created in __init__ now (the build helper only styles and mounts them) so reportUninitializedInstanceVariable stops firing on the ported styling lines, and the queue placeholder uses the scoped Qt.AlignmentFlag.AlignCenter. Co-Authored-By: Claude Fable 5 --- src/aare/gui/panels/portrait_mode.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/aare/gui/panels/portrait_mode.py b/src/aare/gui/panels/portrait_mode.py index 5d66f104..d65231df 100644 --- a/src/aare/gui/panels/portrait_mode.py +++ b/src/aare/gui/panels/portrait_mode.py @@ -257,6 +257,12 @@ class PortraitModePanel(QWidget): self.setMaximumWidth(self.PORTRAIT_WIDTH) self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Expanding) + # Created here rather than in the build helper so the attributes are + # initialized in __init__ (basedpyright gate); the helper styles and + # mounts them. + self._name_lbl = QLabel("—") + self._sub_lbl = QLabel("No sample queued") + self._job_list_panel = None self._tell_samples = None self._is_running = False @@ -350,10 +356,8 @@ class PortraitModePanel(QWidget): cam_card_layout.addWidget(cam_widget) layout.addWidget(cam_card) - # Sample name labels - self._name_lbl = QLabel("—") + # Sample name labels (created in __init__) self._name_lbl.setStyleSheet(f"color: {TEXT}; font-size: {FONT_VALUE}; font-weight: 700;") - self._sub_lbl = QLabel("No sample queued") self._sub_lbl.setStyleSheet(f"color: {SUBTEXT}; font-size: {FONT_HINT};") layout.addWidget(self._name_lbl) layout.addWidget(self._sub_lbl) @@ -606,7 +610,7 @@ class PortraitModePanel(QWidget): placeholder.setStyleSheet( f"color: {SUBTEXT}; font-size: {FONT_LABEL}; font-weight: 700;" ) - placeholder.setAlignment(Qt.AlignCenter) + placeholder.setAlignment(Qt.AlignmentFlag.AlignCenter) self._queue_inner_layout.addWidget(placeholder) return