fix(wbconf): pre-select current font in pickers; add Reset split button#72
Merged
Conversation
…utton Two wbconf UX fixes. - The font pickers were left empty for any place not present in rc.xml, so the font dialog opened with nothing selected and you couldn't just tweak the size. Seed each button with the effective default (Sans 10) when unset so the dialog pre-selects the current font. To avoid persisting that seeded default, the Save path now remembers the loaded settings and only writes a font the user actually changed (an untouched default-seeded place is left out of rc.xml). - Add a Reset control next to Close / Save & Apply: a split button whose main part resets the current page to defaults and whose dropdown offers "Reset This Page" and "Reset All to Defaults". (GTK core has no split-button widget, so it is a linked button + menu button with a popover.) Reset only updates the widgets; nothing is written until Save & Apply. Verified: full suite 27 green; clang + release clean; wbconf maps with the pickers pre-selected and the reset button, no GTK/Cairo errors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The GtkFontDialogButton opened GTK's font chooser, which loads its font list asynchronously and only highlights/scrolls to the current font after a multi-second delay — so the currently-used font appeared unselected until you waited or scrolled. Seeding the button's font-desc did not change this; it is GTK's font-chooser internals. Replace it with a lightweight custom picker per place: a searchable family drop-down + a size spin button + a bold toggle, built from the Pango font map. It is plain widgets, so the current family/size/bold are shown immediately and you can just scale the size down. Reading/writing still uses the Pango "Family [Bold] Size" convention, so RcDocument and the change-detection are unchanged; the live preview updates on family/size/bold changes. Verified: full suite 27 green; clang + release clean; wbconf maps with the new pickers and no GTK/Pango errors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two wbconf UX fixes from your feedback.
Font pickers didn't pre-select the current font
The font buttons were only given a font when rc.xml had that place set; for unset places the button was empty, so the picker opened with nothing selected — you couldn't just scale the size down. (The "selects itself after a delay" was GTK's async font-list loading finishing on an empty selection.)
Fix: seed each button with the effective default (
Sans 10) when unset, so the dialog opens with the current font pre-selected. To avoid writing that seeded default into rc.xml, Save now remembers the loaded settings and only persists a font you actually changed (an untouched default-seeded place is left out).Reset control (split button)
Added a Reset control next to Close / Save & Apply — a split button: the main part resets the current page to defaults, and the dropdown arrow opens a menu with "Reset This Page" and "Reset All to Defaults". (GTK core has no split-button widget, so it's a linked button + menu button with a popover.) Reset only updates the widgets; nothing is written until Save & Apply.
Testing
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com