Skip to content

Auto-generate enum type widget boilerplate for radio buttons and dropdown menus #2589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
May 1, 2025

Conversation

kythyria
Copy link
Contributor

@kythyria kythyria commented Apr 17, 2025

(Mostly) resolves #2587. This refactors the UI for dropdowns and radio buttons based on built-in enums.

Dropdowns and radio buttons associated with node sockets can be produced via a builder API, with this API in turn getting its data from a proc macro that operates on enums. The particular shape should facilitate extending this to user-defined enums, to values that are not associated with a socket, and to menu entries (eg, the ones to add a boolean operation).

@Keavon Keavon force-pushed the rfc-dropdowns-refactor branch from 1512c4a to d571abf Compare April 20, 2025 03:35
@Keavon Keavon marked this pull request as draft April 24, 2025 04:55
@kythyria kythyria marked this pull request as ready for review April 30, 2025 13:43
@Keavon Keavon changed the title Try factoring out the dropdown boilerplate Auto-generate enum type widget boilerplate for radio buttons and dropdown menus May 1, 2025
@TrueDoctor
Copy link
Member

The macro code looks good

@Keavon Keavon merged commit 9ef9b20 into GraphiteEditor:master May 1, 2025
4 checks passed
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.

Ergonomic way to define enums for use by nodes
3 participants