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 GitHub
parent 9b3d07dc51
commit 7c8b189c71
12 changed files with 90 additions and 105 deletions

View File

@@ -10,8 +10,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,
}
@@ -787,10 +789,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,
}