From 2fdb1952b67a5d857f67c50ef07daec2cd61d252 Mon Sep 17 00:00:00 2001 From: Dawn Date: Tue, 8 Sep 2026 11:21:31 +0200 Subject: [PATCH] fix: put Mount next in the automation row, gated to the Queued view The button was parented to the dewar tab but never added to a layout, so Qt painted it at (0, 0) over the TELL sample changer banner. It now sits left of Unmount in the automation row (docked and pop-out), greyed out outside the Queued view like Remove/Clear. A trailing stretch keeps the row's buttons at their natural width instead of sharing the spare space. Co-Authored-By: Claude Fable 5.1 --- src/aare/gui/main_window.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/aare/gui/main_window.py b/src/aare/gui/main_window.py index 5a3187e8..a8cb82ff 100644 --- a/src/aare/gui/main_window.py +++ b/src/aare/gui/main_window.py @@ -597,21 +597,27 @@ class MainWindow(QMainWindow): self.quick_unmount_button = QPushButton("⏏ Unmount", dewar_tab) self.quick_unmount_button.clicked.connect(lambda: self._on_manual_unmount_requested()) - # main_window.py, next to quick_unmount_button (~L597) + # Was parented to dewar_tab but never added to a layout, so Qt + # painted it at (0, 0) — on top of the TELL banner. It lives in the + # automation row, left of Unmount, like the pop-out clone below. self.mount_next_button = QPushButton("⏭ Mount next", dewar_tab) self.mount_next_button.clicked.connect(self._mount_next_from_queue) - # add to automation_row loop + self._queue_action_buttons as kind "next" automation_row = QHBoxLayout() for w in ( self.job_list_panel.play_button, self.job_list_panel.remove_button, self.job_list_panel.clear_button, + self.mount_next_button, self.quick_unmount_button, self.job_list_panel.park_and_dry_when_cleared, self.job_list_panel.pause_on_conditions_cb, ): automation_row.addWidget(w) + # Trailing stretch: without it every widget shares the spare width + # and the buttons balloon; five buttons plus two long checkboxes need + # them at their natural size. + automation_row.addStretch(1) dewar_layout.addLayout(automation_row) # "Remove selected" now unqueues the dewar-table selection — the @@ -630,6 +636,7 @@ class MainWindow(QMainWindow): (self.job_list_panel.play_button, "run"), (self.job_list_panel.remove_button, "queue"), (self.job_list_panel.clear_button, "queue"), + (self.mount_next_button, "queue"), ] self.tell_samples.status_chips.buttonClicked.connect( lambda _chip: self._update_queue_buttons_enabled() @@ -1462,19 +1469,22 @@ class MainWindow(QMainWindow): remove_button.clicked.connect(lambda: self._unqueue_panel_selection(dewar_panel)) clear_button = QPushButton("✖ Clear list") clear_button.clicked.connect(jl.clear) + mount_next_button = QPushButton("⏭ Mount next") + mount_next_button.clicked.connect(self._mount_next_from_queue) unmount_button = QPushButton("⏏ Unmount") unmount_button.clicked.connect(lambda: self._on_manual_unmount_requested()) - # Same Queued-view gating as the docked trio. + # Same Queued-view gating as the docked buttons. self._queue_action_buttons += [ (run_button, "run"), (remove_button, "queue"), (clear_button, "queue"), + (mount_next_button, "queue"), ] self._update_queue_buttons_enabled() row = QHBoxLayout() - for button in (run_button, remove_button, clear_button, unmount_button): + for button in (run_button, remove_button, clear_button, mount_next_button, unmount_button): row.addWidget(button) for source in (jl.park_and_dry_when_cleared, jl.pause_on_conditions_cb): clone = QCheckBox(source.text()) @@ -1485,6 +1495,7 @@ class MainWindow(QMainWindow): clone.toggled.connect(source.setChecked) source.toggled.connect(clone.setChecked) row.addWidget(clone) + row.addStretch(1) # natural button widths, see the docked row return row def _show_admin_tip(self, message: str) -> None: