@@ -24,6 +24,7 @@ use graphene_std::application_io::TextureFrameTable;
24
24
use graphene_std:: ops:: XY ;
25
25
use graphene_std:: transform:: Footprint ;
26
26
use graphene_std:: vector:: VectorDataTable ;
27
+ use graphene_std:: vector:: misc:: ArcType ;
27
28
use graphene_std:: vector:: misc:: { BooleanOperation , GridType } ;
28
29
use graphene_std:: vector:: style:: { Fill , FillChoice , FillType , GradientStops } ;
29
30
use graphene_std:: { GraphicGroupTable , RasterFrame } ;
@@ -208,6 +209,7 @@ pub(crate) fn property_from_type(
208
209
Some ( x) if x == TypeId :: of :: < GridType > ( ) => grid_type_widget ( document_node, node_id, index, name, description, true ) ,
209
210
Some ( x) if x == TypeId :: of :: < LineCap > ( ) => line_cap_widget ( document_node, node_id, index, name, description, true ) ,
210
211
Some ( x) if x == TypeId :: of :: < LineJoin > ( ) => line_join_widget ( document_node, node_id, index, name, description, true ) ,
212
+ Some ( x) if x == TypeId :: of :: < ArcType > ( ) => arc_type_widget ( document_node, node_id, index, name, description, true ) ,
211
213
Some ( x) if x == TypeId :: of :: < FillType > ( ) => vec ! [
212
214
DropdownInput :: new( vec![ vec![
213
215
MenuListEntry :: new( "Solid" )
@@ -1219,6 +1221,31 @@ pub fn line_join_widget(document_node: &DocumentNode, node_id: NodeId, index: us
1219
1221
LayoutGroup :: Row { widgets }
1220
1222
}
1221
1223
1224
+ pub fn arc_type_widget ( document_node : & DocumentNode , node_id : NodeId , index : usize , name : & str , description : & str , blank_assist : bool ) -> LayoutGroup {
1225
+ let mut widgets = start_widgets ( document_node, node_id, index, name, description, FrontendGraphDataType :: General , blank_assist) ;
1226
+ let Some ( input) = document_node. inputs . get ( index) else {
1227
+ log:: warn!( "A widget failed to be built because its node's input index is invalid." ) ;
1228
+ return LayoutGroup :: Row { widgets : vec ! [ ] } ;
1229
+ } ;
1230
+ if let Some ( & TaggedValue :: ArcType ( arc_type) ) = input. as_non_exposed_value ( ) {
1231
+ let entries = [ ( "Open" , ArcType :: Open ) , ( "Closed" , ArcType :: Closed ) , ( "Pie Slice" , ArcType :: PieSlice ) ]
1232
+ . into_iter ( )
1233
+ . map ( |( name, val) | {
1234
+ RadioEntryData :: new ( format ! ( "{val:?}" ) )
1235
+ . label ( name)
1236
+ . on_update ( update_value ( move |_| TaggedValue :: ArcType ( val) , node_id, index) )
1237
+ . on_commit ( commit_value)
1238
+ } )
1239
+ . collect ( ) ;
1240
+
1241
+ widgets. extend_from_slice ( & [
1242
+ Separator :: new ( SeparatorType :: Unrelated ) . widget_holder ( ) ,
1243
+ RadioInput :: new ( entries) . selected_index ( Some ( arc_type as u32 ) ) . widget_holder ( ) ,
1244
+ ] ) ;
1245
+ }
1246
+ LayoutGroup :: Row { widgets }
1247
+ }
1248
+
1222
1249
pub fn color_widget ( document_node : & DocumentNode , node_id : NodeId , index : usize , name : & str , description : & str , color_button : ColorInput , blank_assist : bool ) -> LayoutGroup {
1223
1250
let mut widgets = start_widgets ( document_node, node_id, index, name, description, FrontendGraphDataType :: General , blank_assist) ;
1224
1251
0 commit comments