fix: increase baton hand over button size and make divider more visible
CI / lint (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 / lint (pull_request) Canceled after 0s
CI / test (3.12) (pull_request) Canceled after 0s
CI / test (3.13) (pull_request) Canceled after 0s
CI / test (3.14) (pull_request) Canceled after 0s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Canceled after 0s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Canceled after 0s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Canceled after 0s
CI / test-with-coverage (pull_request) Canceled after 0s
CI / coverage-analysis (pull_request) Canceled after 0s

This commit is contained in:
duan_j committed 2026-09-06 18:02:19 +02:00
1 parent 416302224c
commit cb368f87cd
2 files changed
+29 -7

No files matched your search

+15 -4
View File
@@ -118,6 +118,9 @@ BANNER_TAB_GAP = 6
# separator under the cursor fills with SEPARATOR_HINT. The rest/drag gate
# lives in MainWindow.event(); the QSS :hover part picks the one separator.
SEPARATOR_HINT = "rgba(168, 178, 192, 20%)" # scrollbar-track grey @50%
# Idle fill so the resize line is findable before the hover rest — 10% of the
# hover alpha. Any base QSS fill replaces the native dotted grip; accepted.
SEPARATOR_IDLE = "rgba(168, 178, 192, 2%)"
SEPARATOR_HINT_DELAY_MS = 66 # int, used in code, not QSS
# Theme-switch screenshot cross-fade duration (int ms, used in code).
@@ -223,6 +226,7 @@ DARK_DISABLED = "#3c4a66" # disabled — disabled fills
# Accents — gold is IDENTITY (titles, highlights), blue is ACTION (primary
# buttons); the site keeps the two apart on purpose:
DARK_ACCENT = "#e0913f" # gold
DARK_SEPARATOR_IDLE = "rgba(224, 145, 63, 10%)" # DARK_ACCENT @10%, idle resize line
DARK_ACCENT_HOVER = "#eaa253" # accent2 — brighter gold
DARK_ACCENT_FILL = "#89b4fa" # action blue
DARK_ACCENT_FILL_HOVER = "#9ec2fb" # +10% white, derived (site has no step)
@@ -1092,9 +1096,12 @@ def _sunrise_stylesheet(overrides: dict[str, str] | None = None) -> str:
font-weight: 700;
}
/* No base ::separator rule ON PURPOSE: any QSS fill would replace the
native dotted-grip drawing, and the dots (visible in the dark theme,
which never styled separators) are wanted in both themes. */
/* Idle resize lines: faint fill (10% of the hover alpha) so the drag
target is findable without hunting. This base fill replaces the
native dotted grip — traded away on purpose for discoverability. */
QMainWindow::separator, QSplitter::handle {
background: $separator_idle;
}
/* Resize-line hint — the separatorHint property is flipped by
MainWindow.event() after a 1s hover rest or on press; :hover limits
@@ -1749,7 +1756,11 @@ def _sunset_stylesheet() -> str:
background: transparent;
}
/* Resize-line hint, dark flavor — see the light-theme note. */
/* Idle + hover resize lines, dark flavor — see the light-theme note. */
QMainWindow::separator, QSplitter::handle {
background: $dark_separator_idle;
}
QMainWindow[separatorHint="true"]::separator:hover {
background: $dark_accent;
}
+14 -3
View File
@@ -28,6 +28,10 @@ from aare.gui.styles import (
WHITE,
)
# Tall touch targets for the three baton hand-over buttons (Accept / Refuse /
# Cancel Request) — operators hit these under time pressure.
_BUTTON_HEIGHT = "88px"
class BatonRequestDialog(QDialog):
"""
@@ -122,14 +126,18 @@ class BatonRequestDialog(QDialog):
button_layout = QHBoxLayout()
button_layout.setSpacing(20)
# Height lives in QSS, not setMinimumHeight(): the app stylesheet caps
# every QPushButton at 16px (styles.py) and Qt re-applies that cap via
# setMin/MaxHeight at polish, overwriting any value set here in code.
self.accept_btn = QPushButton("✓ Accept")
self.accept_btn.setMinimumHeight(88)
self.accept_btn.setStyleSheet(f"""
QPushButton {{
background-color: {BATON_OK_BG};
color: {WHITE};
border: none;
border-radius: 5px;
min-height: {_BUTTON_HEIGHT};
max-height: {_BUTTON_HEIGHT};
font-weight: bold;
font-size: {FONT_LABEL};
}}
@@ -144,13 +152,14 @@ class BatonRequestDialog(QDialog):
button_layout.addWidget(self.accept_btn)
self.refuse_btn = QPushButton("✗ Refuse")
self.refuse_btn.setMinimumHeight(88)
self.refuse_btn.setStyleSheet(f"""
QPushButton {{
background-color: {BATON_DANGER_BG};
color: {WHITE};
border: none;
border-radius: 5px;
min-height: {_BUTTON_HEIGHT};
max-height: {_BUTTON_HEIGHT};
font-weight: bold;
font-size: {FONT_LABEL};
}}
@@ -304,13 +313,15 @@ class BatonPendingDialog(QDialog):
button_layout = QHBoxLayout()
self.cancel_btn = QPushButton("✗ Cancel Request")
self.cancel_btn.setMinimumHeight(88)
# See accept_btn in BatonRequestDialog for why height is QSS-only.
self.cancel_btn.setStyleSheet(f"""
QPushButton {{
background-color: {BATON_DANGER_BG};
color: {WHITE};
border: none;
border-radius: 5px;
min-height: {_BUTTON_HEIGHT};
max-height: {_BUTTON_HEIGHT};
font-weight: bold;
font-size: {FONT_LABEL};
}}