mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-16 06:38:03 +08:00
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:
committed by
Dennis Kobert
parent
b635e6fa02
commit
ba5b25112b
@@ -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
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user