Skip to content

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

Merged
Keavon merged 23 commits intoGraphiteEditor:masterfrom
kythyria:rfc-dropdowns-refactor
May 1, 2025
Merged

Auto-generate enum type widget boilerplate for radio buttons and dropdown menus#2589
Keavon merged 23 commits intoGraphiteEditor:masterfrom
kythyria:rfc-dropdowns-refactor

Conversation

@kythyria
Copy link
Copy Markdown
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
Copy Markdown
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