Skip to content

fix(gui): RX Controls hero frequency + sizing fix + layout reorg (#3839 follow-up)#3844

Closed
jensenpat wants to merge 1 commit into
aethersdr:mainfrom
jensenpat:feat/rx-controls-hero-freq
Closed

fix(gui): RX Controls hero frequency + sizing fix + layout reorg (#3839 follow-up)#3844
jensenpat wants to merge 1 commit into
aethersdr:mainfrom
jensenpat:feat/rx-controls-hero-freq

Conversation

@jensenpat

@jensenpat jensenpat commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #3839. That change stopped the frequency clipping, but two things were still off — and the panel earned a tidy-up around the fix.

  1. The digits rendered tiny (~13px). fix(gui): RX Controls hero frequency + never-clip shrink-to-fit (#3463) #3839 drove the fitted pixel size via QWidget::setFont(), but a QLabel whose stylesheet names font-family makes Qt recompute the font from the QSS on every re-polish and discard setFont(), falling back to the ~13px app default — the "frequency is tiny by default" symptom.
  2. The frequency was cramped sharing a row with TX/mode/WFM (~124px), so even sized correctly it couldn't be large.

What this PR does

  • Applies the fitted size through the stylesheet as a literal font-size (which always wins over the cascade), colour/family still from theme tokens so it stays theme-reactive. The last size is cached to skip a re-polish on every tune step, and each freq box is a stable, font-independent width so the fit can't oscillate. FreqLabelFit.h keeps fitFreqPixelSize(); the dead setFont-based helper is removed.
  • Makes the frequency the hero — its own full-width row at ~34px, with the mode selector and TX/WFM toggles on a compact context strip beneath it. The redundant band + filter-bandwidth labels are dropped (band is obvious from the large frequency; bandwidth is shown by the lit preset button + passband graph).
  • Reorganises the controls — volume and AGC are promoted to full-width sliders directly under the mode selector, and STEP moves into the right control group with balance (pan) and squelch. Net top-to-bottom flow: frequency → mode/TX/WFM → volume → AGC → two-column grid (filter presets + passband · STEP, pan, SQL, RIT, XIT).
  • VFO flag: same literal-QSS sizing at the theme-nominal size (unchanged look, now deterministic).

Proof — agent automation bridge (live on a FLEX‑8400M)

tune + grab, before vs after, both themes. Left = before this work (clipped + ~13px); right = hero ~34px with the reorganized controls.

RX Controls — default dark, 21.074 MHz
dark before/after

RX Controls — light theme, 21.074 MHz
light before/after

VFO slice flag — unchanged (theme nominal, no clip)
vfo flag

Files

  • src/gui/FreqLabelFit.hfitFreqPixelSize() (drops the setFont helper)
  • src/gui/RxApplet.{h,cpp} — hero frequency row, context strip, literal-QSS sizing, full-width volume/AGC, STEP regrouped
  • src/gui/VfoWidget.{h,cpp} — literal-QSS sizing + re-fit hooks

Refs #3515, #3463 (#3839 follow-up).

💻 Generated with Claude Code (Opus 4.8) with architecture by @jensenpat

@jensenpat jensenpat requested a review from a team as a code owner June 26, 2026 20:44

@aethersdr-agent aethersdr-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the diff against the surrounding RxApplet/VfoWidget/ThemeManager code. This is a clean, well-reasoned follow-up — nice root-cause writeup on the QSS-vs-setFont() interaction. No blocking issues found.

Correctness — the part I scrutinized hardest is fine. My first worry was that the m_freqFitPx early-return (if (px == m_freqFitPx) return;) could leave the frequency label with stale colour/family after a theme change when the fitted size happens not to move. It doesn't: ThemeManager::applyStyleSheet registers the widget and reapplyAllTrackedStyleSheets re-resolves the last-registered template on every themeChanged. Since that template keeps {{color.text.primary}} / {{font.family.freq}} as live tokens (only font-size is a literal), colour/family stay theme-reactive even on the early-return path, and applyFreqFit (wired to themeChanged) still covers a font.size.freq edit that the smart-invalidation pass would skip. So the cache is safe. 👍

Other checks, all clear:

  • The fit↔reflow oscillation guard holds — the Expanding/Fixed m_freqStack gives a font-independent width, so the restyle can't feed back into a different availW. Worst case is one extra no-op applyFreqFit from the re-polish, which the px cache absorbs.
  • m_filterWidthLbl removal is complete — all five RxApplet references (creation, accessibleName, the three setText sites) are gone, and the header member is dropped.
  • RxApplet::formatFilterWidth is not orphaned — VfoWidget still calls it (RxApplet::formatFilterWidth(...)), so no unused-function warning.
  • Dropping #include <QLabel> from FreqLabelFit.h is safe — the only two includers (RxApplet.cpp, VfoWidget.cpp) both include <QLabel> directly, so no lost-transitive-include (a class that has bitten Linux/Qt-6.4.2 CI before here).
  • No null-deref / leak risks: applyFreqFit guards !m_freqLabel, heroMax guards !m_freqStack, and setFixedHeight makes height() reliable before layout.

One small, non-blocking suggestion: the safety of the m_freqFitPx early-return depends on applyStyleSheet's tracked-reapply behaviour for colour reactivity — a subtle cross-file coupling. The inline comment already notes "applyStyleSheet keeps the colour/family theme-reactive," which is enough, but a half-sentence making explicit that the colour path survives the early-return via the tracked template (not via applyFreqFit) would help the next reader avoid re-deriving it. Purely optional.

Thanks @jensenpat — the declutter rationale (band implied by the large digits, bandwidth already shown by the lit preset + passband graph) is sound, and the before/after evidence is appreciated. Nice work.


🤖 aethersdr-agent · cost: $6.6993 · model: claude-opus-4-8

@jensenpat jensenpat marked this pull request as draft June 26, 2026 21:42
jensenpat pushed a commit to jensenpat/AetherSDR that referenced this pull request Jun 26, 2026
…ethersdr#3839 follow-up)

Follow-up to aethersdr#3839. That change stopped the frequency clipping but drove the
fitted pixel size via QWidget::setFont() — which a QLabel whose stylesheet
names font-family silently discards on every re-polish, so the digits actually
rendered at the ~13px app default ("the frequency is tiny by default"). This
applies the fitted size through the stylesheet as a literal font-size (which
always wins over the cascade), and reorganises the RX Controls panel around it.

- FreqLabelFit.h keeps fitFreqPixelSize(); the size is now applied via the
  label's QSS (literal font-size), with colour/family still resolved from theme
  tokens and the last size cached to avoid a re-polish on every tune step. Each
  freq box is a stable, font-independent width so the fit can't oscillate.
- Hero frequency: its own full-width row at ~34px, with the mode selector and
  the TX/WFM toggles on a compact context strip beneath it. The band and
  filter-bandwidth labels are dropped (the band is obvious from the large
  frequency; bandwidth is already shown by the lit preset button + passband
  graph).
- Volume and AGC are promoted to full-width sliders directly under the mode
  selector; STEP moves into the right control group with balance (pan) and
  squelch. Net top-to-bottom flow: frequency, mode/TX/WFM, volume, AGC, then a
  two-column grid (filter presets + passband | STEP, pan, SQL, RIT, XIT).
- VfoWidget flag: same literal-QSS sizing at the theme nominal.

Proven live on a FLEX-8400M via the agent automation bridge (tune + grab,
before/after, both themes): RX Controls 21.074 MHz shows the full "21.074.000"
at ~34px, 144.2 MHz shows "144.200.000" with no clip, and the VFO flag is
unchanged.

Refs aethersdr#3515, aethersdr#3463 (aethersdr#3839 follow-up).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jensenpat jensenpat force-pushed the feat/rx-controls-hero-freq branch from 27e9493 to 5cba33e Compare June 26, 2026 22:01
@jensenpat jensenpat changed the title fix(gui): render the fitted frequency size + make it the RX Controls hero (#3839 follow-up) fix(gui): RX Controls hero frequency + sizing fix + layout reorg (#3839 follow-up) Jun 26, 2026
@jensenpat jensenpat marked this pull request as ready for review June 26, 2026 22:01
@jensenpat jensenpat closed this Jun 26, 2026
NF0T pushed a commit that referenced this pull request Jun 26, 2026
Reverts #3839.

#3839 landed half-baked. It drove the fitted frequency pixel size via
`QWidget::setFont()`, but a `QLabel` whose stylesheet names
`font-family` makes Qt recompute the font from the QSS on every
re-polish and **discard `setFont()`**, falling back to the ~13px app
default. So the leading digits no longer clip, but the frequency renders
**unreadably small** — the fix is incomplete.

Rather than ship that behavior on `main`, this reverts it. The
**complete** fix is **#3844**:
- the fitted size is applied through the stylesheet as a literal
`font-size` (which always wins over the cascade), so the digits actually
render at the intended size;
- the RX Controls frequency becomes a full-width hero (~34px) with a
reorganized control layout.

Reverts cleanly — no commit since #3839 touched the frequency files.
Build passes.

💻 Generated with Claude Code (Opus 4.8) with architecture by @jensenpat

Co-authored-by: Claude Opus 4.8 <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.

1 participant