Build radio widget entries from choice type metadata so variants display their icons (#4408)

* Build radio widget entries from choice type metadata so variants display their icons

* Route the node properties enum radio through the shared choice type entry builder
This commit is contained in:
Keavon Chambers
2026-08-04 21:16:14 -07:00
committed by Dennis Kobert
parent b635e6fa02
commit ba5b25112b
12 changed files with 90 additions and 105 deletions

View File

@@ -11,8 +11,10 @@ use glam::{DAffine2, DVec2};
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[widget(Radio)]
pub enum GradientForm {
/// Transitions the colors along a straight line.
#[default]
Linear,
/// Transitions the colors outward from a center point.
Radial,
}
@@ -788,10 +790,13 @@ impl Gradient {
pub enum GradientSpread {
/// Extends the end colors outward.
#[default]
#[icon("GradientSpreadPad")]
Pad,
/// Loops the gradient by mirroring back-and-forth.
#[icon("GradientSpreadReflect")]
Reflect,
/// Loops the gradient as copies of itself.
#[icon("GradientSpreadRepeat")]
Repeat,
// TODO: Add a "Clear" variant that returns transparent black outside the gradient's range
}

View File

@@ -155,9 +155,12 @@ pub enum GridType {
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[widget(Radio)]
pub enum ArcType {
/// Leaves the two ends of the arc unconnected.
#[default]
Open = 0,
/// Connects the two ends of the arc with a straight line.
Closed,
/// Connects the two ends of the arc to its center, forming a wedge.
PieSlice,
}