fix: declutter the Local Contact view
CI / lint (push) Skipped
CI / test (3.11) (push) Skipped
CI / test (3.12) (push) Skipped
CI / test (3.13) (push) Skipped
CI / test-with-beamline-plugins (pxi_bec) (push) Skipped
CI / test-with-beamline-plugins (pxii_bec) (push) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (push) Skipped
CI / test (3.11) (pull_request) Successful in 54s
CI / test (3.13) (pull_request) Successful in 55s
CI / lint (pull_request) Successful in 1m33s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 56s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Successful in 1m10s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 1m49s
CI / test-with-coverage (pull_request) Successful in 1m8s
CI / coverage-analysis (pull_request) Successful in 3s
CI / test (3.12) (pull_request) Successful in 8m49s
CI / lint (push) Skipped
CI / test (3.11) (push) Skipped
CI / test (3.12) (push) Skipped
CI / test (3.13) (push) Skipped
CI / test-with-beamline-plugins (pxi_bec) (push) Skipped
CI / test-with-beamline-plugins (pxii_bec) (push) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (push) Skipped
CI / test (3.11) (pull_request) Successful in 54s
CI / test (3.13) (pull_request) Successful in 55s
CI / lint (pull_request) Successful in 1m33s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 56s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Successful in 1m10s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 1m49s
CI / test-with-coverage (pull_request) Successful in 1m8s
CI / coverage-analysis (pull_request) Successful in 3s
CI / test (3.12) (pull_request) Successful in 8m49s
- drop the redundant Local Contact banner (the window title carries it) - remove the three parent=self config spinboxes that painted themselves over the top-left corner; parentless placeholders are replaced in _build_config_tab - remove all rounded corners (status card, value badges, group boxes, transfer-error frame, recovery panels) - tighten status rows to 2px spacing with a per-row minimum height so word-wrapped value labels can never compress rows until text clips (previously visible on the Hardware tab) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -40,7 +40,6 @@ class RecoveryPanel(QWidget):
|
||||
" background: #fff3cd;"
|
||||
" color: #7a4b00;"
|
||||
" border: 1px solid #f0c36d;"
|
||||
" border-radius: 8px;"
|
||||
" padding: 10px;"
|
||||
" font-weight: 600;"
|
||||
"}"
|
||||
@@ -57,7 +56,6 @@ class RecoveryPanel(QWidget):
|
||||
" background: #fdeaea;"
|
||||
" color: #8b1e1e;"
|
||||
" border: 1px solid #e6a8a8;"
|
||||
" border-radius: 8px;"
|
||||
" padding: 10px;"
|
||||
" font-weight: 600;"
|
||||
"}"
|
||||
@@ -71,7 +69,6 @@ class RecoveryPanel(QWidget):
|
||||
" background: #eef6ff;"
|
||||
" color: #12406a;"
|
||||
" border: 1px solid #a8c7e6;"
|
||||
" border-radius: 8px;"
|
||||
" padding: 10px;"
|
||||
" font-weight: 600;"
|
||||
"}"
|
||||
@@ -83,7 +80,6 @@ class RecoveryPanel(QWidget):
|
||||
"QPushButton {"
|
||||
" background: #fff7db;"
|
||||
" border: 1px solid #e7cb73;"
|
||||
" border-radius: 8px;"
|
||||
" padding: 10px;"
|
||||
" font-weight: 600;"
|
||||
"}"
|
||||
@@ -96,7 +92,6 @@ class RecoveryPanel(QWidget):
|
||||
"QPushButton {"
|
||||
" background: #fff7db;"
|
||||
" border: 1px solid #e7cb73;"
|
||||
" border-radius: 8px;"
|
||||
" padding: 10px;"
|
||||
" font-weight: 600;"
|
||||
"}"
|
||||
@@ -110,7 +105,6 @@ class RecoveryPanel(QWidget):
|
||||
" background: #fdeaea;"
|
||||
" color: #8b1e1e;"
|
||||
" border: 1px solid #e6a8a8;"
|
||||
" border-radius: 8px;"
|
||||
" padding: 10px;"
|
||||
" font-weight: 700;"
|
||||
"}"
|
||||
@@ -124,7 +118,6 @@ class RecoveryPanel(QWidget):
|
||||
" background: #fdeaea;"
|
||||
" color: #8b1e1e;"
|
||||
" border: 1px solid #e6a8a8;"
|
||||
" border-radius: 8px;"
|
||||
" padding: 10px;"
|
||||
" font-weight: 700;"
|
||||
"}"
|
||||
@@ -138,7 +131,6 @@ class RecoveryPanel(QWidget):
|
||||
" background: #eef6ff;"
|
||||
" color: #12406a;"
|
||||
" border: 1px solid #a8c7e6;"
|
||||
" border-radius: 8px;"
|
||||
" padding: 10px;"
|
||||
" font-weight: 600;"
|
||||
"}"
|
||||
|
||||
@@ -31,7 +31,6 @@ from aare.gui.panels.beamline_recovery_panel import RecoveryPanel
|
||||
from aare.gui.threads.daq_worker import DAQWorker
|
||||
from aare.gui.widgets.local_contact_status_widget import LocalContactStatusWidget
|
||||
from aare.gui.widgets.text_list_dialog import TextListDialog
|
||||
from aare.gui.widgets.title_label import TitleLabel
|
||||
|
||||
logger = setup_logger(LOGGER_NAME)
|
||||
|
||||
@@ -65,9 +64,12 @@ class LocalContactPanel(QFrame):
|
||||
self._bec_macros_dialog: TextListDialog | None = None
|
||||
self._bec_devices_dialog: TextListDialog | None = None
|
||||
self._local_contact_config_payload: dict = {}
|
||||
self._mount_to_center_sleep_s = QDoubleSpinBox(self)
|
||||
self._line_scan_loop_face_y_padding_fraction_each_side = QDoubleSpinBox(self)
|
||||
self._line_scan_loop_all_y_padding_fraction_each_side = QDoubleSpinBox(self)
|
||||
# Recreated with proper parents in _build_config_tab; parentless here
|
||||
# so no orphan widget floats over the panel (the old parent=self
|
||||
# copies painted themselves over the top-left corner).
|
||||
self._mount_to_center_sleep_s = QDoubleSpinBox()
|
||||
self._line_scan_loop_face_y_padding_fraction_each_side = QDoubleSpinBox()
|
||||
self._line_scan_loop_all_y_padding_fraction_each_side = QDoubleSpinBox()
|
||||
|
||||
self.setFrameShape(QFrame.Shape.StyledPanel)
|
||||
self.setFrameShadow(QFrame.Shadow.Raised)
|
||||
@@ -76,7 +78,6 @@ class LocalContactPanel(QFrame):
|
||||
QGroupBox {
|
||||
background-color: white;
|
||||
border: 1px solid #c7d4e5;
|
||||
border-radius: 5px;
|
||||
margin-top: 15px;
|
||||
padding-top: 15px;
|
||||
font-weight: 700;
|
||||
@@ -96,8 +97,7 @@ class LocalContactPanel(QFrame):
|
||||
layout.setContentsMargins(8, 8, 8, 8)
|
||||
layout.setSpacing(8)
|
||||
|
||||
layout.addWidget(TitleLabel("Local Contact", parent=self))
|
||||
|
||||
# No TitleLabel banner: the dialog window title already says it.
|
||||
self._info_label = QLabel(
|
||||
"Staff tools for beamline recovery and local-contact operations.", self
|
||||
)
|
||||
@@ -107,12 +107,7 @@ class LocalContactPanel(QFrame):
|
||||
self._transfer_error_frame = QFrame(self)
|
||||
self._transfer_error_frame.setVisible(False)
|
||||
self._transfer_error_frame.setStyleSheet(
|
||||
"QFrame {"
|
||||
" background: #fdeaea;"
|
||||
" color: #8b1e1e;"
|
||||
" border: 1px solid #e6a8a8;"
|
||||
" border-radius: 8px;"
|
||||
"}"
|
||||
"QFrame { background: #fdeaea; color: #8b1e1e; border: 1px solid #e6a8a8;}"
|
||||
)
|
||||
transfer_error_layout = QVBoxLayout(self._transfer_error_frame)
|
||||
transfer_error_layout.setContentsMargins(10, 10, 10, 10)
|
||||
|
||||
@@ -83,7 +83,6 @@ class LocalContactStatusWidget(QFrame):
|
||||
QFrame#localContactStatusCard {
|
||||
background: #f8fbff;
|
||||
border: 1px solid #c7d4e5;
|
||||
border-radius: 10px;
|
||||
}
|
||||
"""
|
||||
)
|
||||
@@ -103,7 +102,8 @@ class LocalContactStatusWidget(QFrame):
|
||||
self._grid = QGridLayout()
|
||||
self._grid.setContentsMargins(0, 0, 0, 0)
|
||||
self._grid.setHorizontalSpacing(14)
|
||||
self._grid.setVerticalSpacing(5)
|
||||
# Tight rows; the badge keeps 2px vertical padding so text never clips.
|
||||
self._grid.setVerticalSpacing(2)
|
||||
layout.addLayout(self._grid)
|
||||
|
||||
self._rebuild_rows()
|
||||
@@ -139,6 +139,10 @@ class LocalContactStatusWidget(QFrame):
|
||||
self._row_widgets[key] = (title, value)
|
||||
self._grid.addWidget(title, row, 0, alignment=Qt.AlignmentFlag.AlignTop)
|
||||
self._grid.addWidget(value, row, 1)
|
||||
# Word-wrapped value labels report a near-zero minimum height, so
|
||||
# cramped tabs (e.g. Hardware) could compress rows until the text
|
||||
# clipped; guarantee one full text line + badge padding per row.
|
||||
self._grid.setRowMinimumHeight(row, self.fontMetrics().height() + 6)
|
||||
|
||||
def _badge(self, text: str, *, tone: str = "neutral") -> str:
|
||||
palette = {
|
||||
@@ -151,7 +155,7 @@ class LocalContactStatusWidget(QFrame):
|
||||
background, foreground = palette.get(tone, palette["neutral"])
|
||||
return (
|
||||
f"<span style='background:{background};color:{foreground};"
|
||||
f"padding:2px 6px;border-radius:8px;'><b>{text}</b></span>"
|
||||
f"padding:2px 6px;'><b>{text}</b></span>"
|
||||
)
|
||||
|
||||
def _format_bool(
|
||||
|
||||
Reference in New Issue
Block a user