Skip to content

Fix WinForms button color rendering#4431

Open
johnzhou721 wants to merge 8 commits into
beeware:mainfrom
johnzhou721:winforms-color
Open

Fix WinForms button color rendering#4431
johnzhou721 wants to merge 8 commits into
beeware:mainfrom
johnzhou721:winforms-color

Conversation

@johnzhou721
Copy link
Copy Markdown
Contributor

Fixes #4342.

This PR fixes the button rendering issue by taking the following approach:

  • Storing native colors for defaults and converting on-demand instead, so system colors work.
  • When resetting background color and when we're resetting to a predefined color for the widget, reset to default and set UseVisualStyleBackColor on the widget if it exists on the widget.
  • All the bookkeeping changes from the above.

Draft for now to run CI.

PR Checklist:

  • I will abide by the BeeWare Code of Conduct
  • I have read and have followed the CONTRIBUTING.md file
  • This PR was generated or assisted using an AI tool

Assisted-by:

@johnzhou721
Copy link
Copy Markdown
Contributor Author

johnzhou721 commented May 31, 2026

Docs linting should be intermittent; this is ready for review, but I would appreciate a formal approval for this only after #4434 [edit: is merged], since the two conflicts. Feel free to do a review of the code and point out changes or comment without approval, though.

@johnzhou721 johnzhou721 marked this pull request as ready for review May 31, 2026 18:07
@johnzhou721
Copy link
Copy Markdown
Contributor Author

This has adapted to #4434, and is ready for final review; reviewers should manually test both #4434's behavior and the behavior documented in the issue of the PR itself (i.e. run toga-demo and verify that the internal appearance of the button is consistent).

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.

WinForms button color rendering

1 participant