fix(gui): RX Controls hero frequency + sizing fix + layout reorg (#3839 follow-up)#3844
fix(gui): RX Controls hero frequency + sizing fix + layout reorg (#3839 follow-up)#3844jensenpat wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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/Fixedm_freqStackgives a font-independent width, so the restyle can't feed back into a differentavailW. Worst case is one extra no-opapplyFreqFitfrom the re-polish, which the px cache absorbs. m_filterWidthLblremoval is complete — all five RxApplet references (creation, accessibleName, the threesetTextsites) are gone, and the header member is dropped.RxApplet::formatFilterWidthis not orphaned —VfoWidgetstill calls it (RxApplet::formatFilterWidth(...)), so no unused-function warning.- Dropping
#include <QLabel>fromFreqLabelFit.his 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:
applyFreqFitguards!m_freqLabel,heroMaxguards!m_freqStack, andsetFixedHeightmakesheight()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
…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>
27e9493 to
5cba33e
Compare
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>
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.
QWidget::setFont(), but aQLabelwhose stylesheet namesfont-familymakes Qt recompute the font from the QSS on every re-polish and discardsetFont(), falling back to the ~13px app default — the "frequency is tiny by default" symptom.What this PR does
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.hkeepsfitFreqPixelSize(); the deadsetFont-based helper is removed.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

RX Controls — light theme, 21.074 MHz

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

Files
src/gui/FreqLabelFit.h—fitFreqPixelSize()(drops thesetFonthelper)src/gui/RxApplet.{h,cpp}— hero frequency row, context strip, literal-QSS sizing, full-width volume/AGC, STEP regroupedsrc/gui/VfoWidget.{h,cpp}— literal-QSS sizing + re-fit hooksRefs #3515, #3463 (#3839 follow-up).
💻 Generated with Claude Code (Opus 4.8) with architecture by @jensenpat