style: small panel polish

Energy unit moves from spinbox suffix to the label (the suffix ate
field width next to the new spin arrows); samcam exposure/gain get a
3:2 stretch so 3-decimal exposure isn't cut; the Exp. Config. tab bar
gets a BANNER_TAB_GAP spacer under its banner.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-11 10:35:55 +02:00
co-authored by Claude Fable 5
parent c179ea992c
commit f7194ca3a4
4 changed files with 16 additions and 4 deletions
@@ -20,6 +20,7 @@ from aare.gui.panels.raster_data_collection import RasterDataCollectionPanel
from aare.gui.panels.rotation_data_collection import RotationDataCollectionPanel
from aare.gui.panels.smart_rotation_panel import SimpleRotationSettingsPanel
from aare.gui.scan_logic.raster_grid_manager import RasterGridManager
from aare.gui.styles import BANNER_TAB_GAP
from aare.gui.widgets.title_label import TitleLabel, tighten_column
@@ -102,6 +103,9 @@ class DataCollectionSettings(QFrame):
"Experiment configuration", exp_config, collapsible=True, default_collapsed=False
)
)
# Explicit spacer, not layout spacing: the tab bar must keep sitting
# flush on the pane below, only the banner gets breathing room.
exp_config_layout.addSpacing(BANNER_TAB_GAP)
exp_config_layout.addWidget(self._tab_bar)
exp_config_layout.addWidget(pane)
v_layout.addWidget(exp_config)
+3 -2
View File
@@ -23,13 +23,14 @@ class MonochromatorPanel(QWidget):
# One row (label | value | button) instead of three — vertical space.
# Display in keV; the DAQ API stays in eV (converted on emit).
grid_layout.addWidget(QLabel("Energy", parent=self), 2, 0)
# Unit lives in the label, not as a spinbox suffix — the suffix ate
# field width and sat between the value and the +/- arrow.
grid_layout.addWidget(QLabel("Energy (keV)", parent=self), 2, 0)
self.energy_spin = QDoubleSpinBox(parent=self)
self.energy_spin.setDecimals(3)
self.energy_spin.setRange(1.0, 30.0)
self.energy_spin.setSingleStep(0.1)
self.energy_spin.setSuffix(" keV")
self.energy_spin.setValue(12.0)
grid_layout.addWidget(self.energy_spin, 2, 1)
+4 -2
View File
@@ -54,10 +54,12 @@ class SamcamPanel(QWidget):
self.gain_spinbox.setDecimals(1)
self.gain_spinbox.valueChanged.connect(self._changed)
# 3:2 stretch — exposure shows 3 decimals plus the side arrows and
# was getting cut; gain (1 decimal) can afford the narrower field.
exposure_gain_layout.addWidget(QLabel("Exposure (s):"))
exposure_gain_layout.addWidget(self.exposure_spinbox)
exposure_gain_layout.addWidget(self.exposure_spinbox, 3)
exposure_gain_layout.addWidget(QLabel("Gain:"))
exposure_gain_layout.addWidget(self.gain_spinbox)
exposure_gain_layout.addWidget(self.gain_spinbox, 2)
# Persist the current gain/exposure as the beam-location preset for the
# current zoom (only meaningful in beam-location mode).
+5
View File
@@ -93,6 +93,11 @@ FRAME_L3_COLOR = "#c9cfd8"
# left edge lines up with the left-column panels above (Loop centering).
DOCK_CONTENT_LEFT_PAD = 10
# Gap (px, int — used in code, not QSS) between a TitleLabel banner and a tab
# bar sitting directly under it (Exp. Config.), so the tabs don't touch the
# banner's bottom edge line.
BANNER_TAB_GAP = 6
# Resize-line hint: dock separators stay invisible until the mouse rests on
# one for SEPARATOR_HINT_DELAY_MS (or a drag starts) — then only the exact
# separator under the cursor fills with SEPARATOR_HINT. The rest/drag gate