feat(ui): per-widget button colors + hover/pressed shades (#566, first slice of #594)#596
Merged
Merged
Conversation
…e of #594) _render_button honors optional bg / text_color fields on the button dict with theme fallback — the toggle_button (color_on/color_off) and label (color) pattern — so semantic coloring works: the record-red / play-green transport buttons DeslanStudio dropped (PORTING.md F-DS-12) now render. Custom-colored buttons get hover/pressed feedback via new theme hover_shade / pressed_shade alpha overlays drawn over the custom bg (a theme-color swap would erase the color). Theme-colored buttons keep the exact btn_hover/btn_pressed swap — existing apps render unchanged. set_theme replaces the theme dict wholesale, so custom themes without the new keys degrade gracefully (null shade = no overlay). All three built-in themes gain tuned shades. Docs: gfx_rrect and gfx_clip were registered but absent from BUILTINS.md (the #393 undiscoverability class — downstream kept believing there is no rounded-rect primitive); rows added. Tests: test_ui renders a custom-colored button through every state (rest/hover/pressed/disabled) and asserts the overrides survive; [63] is now 118 checks. Gates: release 2866/2866; ASan+UBSan detect_leaks=1 2870/2870 (tally 0); gfx-build suite 2907/2907. Visual proof on the real X display: Stop/Play/Record/Theme row with the Record button hover-shaded. Closes #566 Co-Authored-By: Claude Fable 5 <noreply@anthropic.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.
What
First slice of #594 (modern widget chrome), prioritizing #566 per the DeslanStudio side-by-side.
_render_buttonhonors optionalbg/text_colorfields on the button dict, falling back to the theme — the existingtoggle_button/labelper-widget pattern. Semantic coloring (record-red, play-green) now works; DeslanStudio can restore the transport colors it ledgered away (F-DS-12).hover_shade/pressed_shadealpha overlays over the custom bg (abtn_hovercolor swap would erase the color). Theme-colored buttons keep the exact existing swap — zero visual change for existing apps. Custom theme dicts without the new keys degrade gracefully (no shade).gfx_rrect/gfx_clipwere registered but missing from BUILTINS.md (lib/ui: modern widget chrome — per-widget colors (#566 priority), hover feedback on all interactive widgets, document gfx_rrect #594 item 3, the CI gate: every builtin and public stdlib function must be documented (regex_* currently appear nowhere) #393 undiscoverability class) — rows added.Tests
test_ui.eigsrenders a custom-colored button through rest/hover/pressed/disabled and asserts the overrides survive; section [63] is now 118 checks.Gates (local, this branch)
detect_leaks=1: 2870/2870, leak tally 0Visual proof
Real-X-display render kept at
/tmp/claude-1000/btn-proof.png: Stop (white) / Play (green) / Record (red, shown hover-shaded) / Theme (unchanged theme gray), rounded + antialiased TTF labels from #595.Closes #566
Remaining #594 items (hover feedback on checkbox/toggle) stay open on #594.
🤖 Generated with Claude Code