From cb368f87cd06172a05f39d2a1ce527b192c89091 Mon Sep 17 00:00:00 2001 From: Dawn Date: Sun, 6 Sep 2026 18:02:19 +0200 Subject: [PATCH] fix: increase baton hand over button size and make divider more visible --- src/aare/gui/styles.py | 19 +++++++++++++++---- src/aare/gui/widgets/baton_request_dialog.py | 17 ++++++++++++++--- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/aare/gui/styles.py b/src/aare/gui/styles.py index 618f9a81..a3cf3852 100644 --- a/src/aare/gui/styles.py +++ b/src/aare/gui/styles.py @@ -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; } diff --git a/src/aare/gui/widgets/baton_request_dialog.py b/src/aare/gui/widgets/baton_request_dialog.py index 1d0136b8..0bc9c919 100644 --- a/src/aare/gui/widgets/baton_request_dialog.py +++ b/src/aare/gui/widgets/baton_request_dialog.py @@ -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}; }}