Skip to content

feat(gui): expose single-click discrimination interval as user setting (#3009)#3015

Merged
ten9876 merged 1 commit into
mainfrom
auto/issue-3009-click-interval
May 23, 2026
Merged

feat(gui): expose single-click discrimination interval as user setting (#3009)#3015
ten9876 merged 1 commit into
mainfrom
auto/issue-3009-click-interval

Conversation

@ten9876

@ten9876 ten9876 commented May 23, 2026

Copy link
Copy Markdown
Collaborator

Closes #3009.

Several widgets (slice mute button, RX chain stages, waveform widgets) defer the single-click action by QApplication::doubleClickInterval() (~400 ms on Linux) so a double-click can override it. Power users wanted instant single-click; users with slower input wanted longer windows. This PR makes the interval a project-wide AppSettings key with a UI surface.

Changes

src/gui/InteractionSettings.h (new)

Inline accessor clickDiscriminationIntervalMs() reads AppSettings key ClickDiscriminationIntervalMs, falls back to platform default if missing/malformed/negative. 0 is honoured and means "fire single-click instantly" (also disables the double-click affordances on widgets that use this gate).

Migrated 7 call sites

The two waveform widgets previously called QTimer::setInterval() at construction. Switching to start(clickDiscriminationIntervalMs()) at click time means a user-adjusted Radio Setup value propagates without an app restart.

UI surface

New "Single-click delay" group in Radio Setup → Themes tab (which is buildUiEnhancementsTab() internally). 0-1000 ms QSpinBox defaulted to platform value, Reset button restores platform default, descriptive label explains the 0 = instant-single-click semantics.

Test plan

  • Builds clean
  • Open Radio Setup → Themes, verify "Single-click delay" group renders with platform default
  • Set delay to 100, click slice mute button — verify ~100 ms perceived latency
  • Set delay to 0, click slice mute button — verify instant response
  • Set delay to 0, double-click slice mute button — verify the double-click action no longer fires (both clicks fire single-click toggles)
  • Click Reset, verify spinbox returns to platform default

🤖 Generated with Claude Code

#3009)

Several widgets (slice mute button, RX chain stages, waveform widgets)
defer the single-click action by QApplication::doubleClickInterval()
so a double click within the window can override it.  The platform
default is typically 400 ms on Linux, 500 ms on Windows — a real cost
on the most common single-click path that power users may want
shorter (or zero), and users with slower motor input may want longer.

Centralize the value as a project-wide AppSettings key and expose it
in Radio Setup.

Changes:

- New src/gui/InteractionSettings.h with inline accessor:
  clickDiscriminationIntervalMs() reads AppSettings key
  'ClickDiscriminationIntervalMs' and falls back to the platform
  default if the key is missing or malformed.  Negative values are
  also coerced to the platform default; 0 is honoured and means
  'fire single-click instantly' (which disables double-click
  affordances on widgets that use this gate).

- Migrate all seven existing call sites of
  QApplication::doubleClickInterval() to the new helper:
  RxApplet (slice mute), StripRxChainWidget, ClientRxChainWidget,
  ClientChainWidget, StripChainWidget, WaveformWidget, StripWaveform.

  Two of the seven (WaveformWidget, StripWaveform) previously cached
  the value at construction via QTimer::setInterval; they now read
  at click time via start(clickDiscriminationIntervalMs()) so a
  user-adjusted Radio Setup value propagates without an app restart.
  The other five already called the helper at click time.

- Add a 'Single-click delay' group to Radio Setup → Themes tab
  (which is buildUiEnhancementsTab() internally).  Group contains a
  0-1000 ms QSpinBox (defaulted to platform value), a Reset button
  that restores the platform default, and a descriptive label
  explaining the 0 = instant single-click semantics.

Closes #3009.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ten9876 ten9876 requested a review from jensenpat as a code owner May 23, 2026 18:53
@ten9876 ten9876 enabled auto-merge (squash) May 23, 2026 18:53
@ten9876 ten9876 merged commit 6e40605 into main May 23, 2026
4 checks passed
@ten9876 ten9876 deleted the auto/issue-3009-click-interval branch May 23, 2026 19:13
G6PWY-Chris pushed a commit to G6PWY-Chris/AetherSDR that referenced this pull request Jun 22, 2026
aethersdr#3009) (aethersdr#3015)

Closes aethersdr#3009.

Several widgets (slice mute button, RX chain stages, waveform widgets)
defer the single-click action by `QApplication::doubleClickInterval()`
(~400 ms on Linux) so a double-click can override it. Power users wanted
instant single-click; users with slower input wanted longer windows.
This PR makes the interval a project-wide AppSettings key with a UI
surface.

## Changes

### `src/gui/InteractionSettings.h` (new)
Inline accessor `clickDiscriminationIntervalMs()` reads AppSettings key
`ClickDiscriminationIntervalMs`, falls back to platform default if
missing/malformed/negative. `0` is honoured and means "fire single-click
instantly" (also disables the double-click affordances on widgets that
use this gate).

### Migrated 7 call sites
- `RxApplet.cpp` (slice mute button — aethersdr#3006)
- `StripRxChainWidget.cpp`
- `ClientRxChainWidget.cpp`
- `ClientChainWidget.cpp`
- `StripChainWidget.cpp`
- `WaveformWidget.cpp` — also dropped construction-time cache; reads at
click time
- `StripWaveform.cpp` — same

The two waveform widgets previously called `QTimer::setInterval()` at
construction. Switching to `start(clickDiscriminationIntervalMs())` at
click time means a user-adjusted Radio Setup value propagates without an
app restart.

### UI surface
New "Single-click delay" group in **Radio Setup → Themes** tab (which is
`buildUiEnhancementsTab()` internally). 0-1000 ms QSpinBox defaulted to
platform value, Reset button restores platform default, descriptive
label explains the 0 = instant-single-click semantics.

## Test plan

- [x] Builds clean
- [ ] Open Radio Setup → Themes, verify "Single-click delay" group
renders with platform default
- [ ] Set delay to 100, click slice mute button — verify ~100 ms
perceived latency
- [ ] Set delay to 0, click slice mute button — verify instant response
- [ ] Set delay to 0, double-click slice mute button — verify the
double-click action no longer fires (both clicks fire single-click
toggles)
- [ ] Click Reset, verify spinbox returns to platform default

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose single-click/double-click discrimination interval as a user-adjustable setting

1 participant