fix: resolve font weights dynamically for live slider updates#7120
Conversation
Widgets registered via GUIUtil::setFont() stored the actual QFont::Weight value at registration time. When font weight sliders were adjusted, the stored weight remained unchanged, preventing live updates. This refactors FontAttrib to use the existing FontWeight enum (Bold/Normal) instead of storing QFont::Weight values. Both setFont() and getFont() now accept FontWeight, which is resolved to the current registry value during updateFonts() and getFont() calls. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
WalkthroughThis pull request refactors the font weight handling system in the Qt GUI. Previously, font weights were retrieved dynamically using registry accessor methods ( Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 🧪 Unit Test Generation v2 is now available!We have significantly improved our unit test generation capabilities. To enable: Add this to your reviews:
finishing_touches:
unit_tests:
enabled: trueTry it out by using the Have feedback? Share your thoughts on our Discord thread! Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/qt/guiutil_font.cpp`:
- Around line 189-219: The code in getFontWithWeight (references:
MONTSERRAT_FONT_STR, mapMontserrat, g_default_font) has formatting drift; re-run
the project's clang-format (or clang-format-diff.py) on src/qt/guiutil_font.cpp
(at the getFontWithWeight function) to apply the repository's style rules, then
stage the updated file so CI sees no formatting diffs.




Issue being fixed or feature implemented
Widgets registered via
GUIUtil::setFont()stored the actualQFont::Weightvalue at registration time. When font weight sliders were adjusted, the stored weight remained unchanged, preventing live updates.Discovered while reviewing #7112
What was done?
This refactors
FontAttribto use the existingFontWeightenum (Bold/Normal) instead of storingQFont::Weightvalues. BothsetFont()andgetFont()now acceptFontWeight, which is resolved to the current registry value duringupdateFonts()andgetFont()calls.How Has This Been Tested?
Run dash-qt, go to Preferences -> Appearance tab and move
Font Weight Boldback and forth.develop: no visual changes on Overview tab
this branch: text on Overview tab adjusts accordingly
Breaking Changes
n/a
Checklist: