@@ -162,7 +162,7 @@ impl MessageHandler<PropertiesPanelMessage, &GrapheneDocument> for PropertiesPan
162
162
ModifyStroke { color, weight } => {
163
163
let path = self . active_path . clone ( ) . expect ( "Received update for properties panel with no active layer" ) ;
164
164
let layer = graphene_document. layer ( & path) . unwrap ( ) ;
165
- if let Some ( color) = Color :: from_rgba_str ( & color) . or ( Color :: from_rgb_str ( & color) ) {
165
+ if let Some ( color) = Color :: from_rgba_str ( & color) . or_else ( || Color :: from_rgb_str ( & color) ) {
166
166
let stroke = Stroke :: new ( color, weight as f32 ) ;
167
167
responses. push_back ( Operation :: SetLayerStroke { path, stroke } . into ( ) )
168
168
} else {
@@ -214,15 +214,15 @@ fn register_layer_properties(layer: &Layer, responses: &mut VecDeque<Message>) {
214
214
widgets: vec![
215
215
match & layer. data {
216
216
LayerDataType :: Folder ( _) => WidgetHolder :: new( Widget :: IconLabel ( IconLabel {
217
- icon: "NodeTypeFolder " . into( ) ,
217
+ icon: "NodeFolder " . into( ) ,
218
218
gap_after: true ,
219
219
} ) ) ,
220
220
LayerDataType :: Shape ( _) => WidgetHolder :: new( Widget :: IconLabel ( IconLabel {
221
- icon: "NodeTypePath " . into( ) ,
221
+ icon: "NodePath " . into( ) ,
222
222
gap_after: true ,
223
223
} ) ) ,
224
224
LayerDataType :: Text ( _) => WidgetHolder :: new( Widget :: IconLabel ( IconLabel {
225
- icon: "NodeTypePath " . into( ) ,
225
+ icon: "NodeText " . into( ) ,
226
226
gap_after: true ,
227
227
} ) ) ,
228
228
} ,
@@ -258,7 +258,7 @@ fn register_layer_properties(layer: &Layer, responses: &mut VecDeque<Message>) {
258
258
vec ! [ ]
259
259
}
260
260
LayerDataType :: Shape ( shape) => {
261
- if let Some ( fill_layout) = node_section_fill ( & shape. style . fill ( ) ) {
261
+ if let Some ( fill_layout) = node_section_fill ( shape. style . fill ( ) ) {
262
262
vec ! [ node_section_transform( layer) , fill_layout, node_section_stroke( & shape. style. stroke( ) . unwrap_or_default( ) ) ]
263
263
} else {
264
264
vec ! [ node_section_transform( layer) , node_section_stroke( & shape. style. stroke( ) . unwrap_or_default( ) ) ]
@@ -267,7 +267,7 @@ fn register_layer_properties(layer: &Layer, responses: &mut VecDeque<Message>) {
267
267
LayerDataType :: Text ( text) => {
268
268
vec ! [
269
269
node_section_transform( layer) ,
270
- node_section_fill( & text. style. fill( ) ) . expect( "Text should have fill" ) ,
270
+ node_section_fill( text. style. fill( ) ) . expect( "Text should have fill" ) ,
271
271
node_section_stroke( & text. style. stroke( ) . unwrap_or_default( ) ) ,
272
272
]
273
273
}
@@ -421,13 +421,13 @@ fn node_section_fill(fill: &Fill) -> Option<LayoutRow> {
421
421
..TextLabel :: default ( )
422
422
} ) ) ,
423
423
WidgetHolder :: new( Widget :: Separator ( Separator {
424
- separator_type: SeparatorType :: Related ,
424
+ separator_type: SeparatorType :: Unrelated ,
425
425
direction: SeparatorDirection :: Horizontal ,
426
426
} ) ) ,
427
427
WidgetHolder :: new( Widget :: ColorInput ( ColorInput {
428
428
value: color. rgba_hex( ) ,
429
429
on_update: WidgetCallback :: new( |text_input: & ColorInput | {
430
- if let Some ( color) = Color :: from_rgba_str( & text_input. value) . or ( Color :: from_rgb_str( & text_input. value) ) {
430
+ if let Some ( color) = Color :: from_rgba_str( & text_input. value) . or_else ( || Color :: from_rgb_str( & text_input. value) ) {
431
431
let new_fill = Fill :: Solid ( color) ;
432
432
PropertiesPanelMessage :: ModifyFill { fill: new_fill } . into( )
433
433
} else {
@@ -452,13 +452,13 @@ fn node_section_fill(fill: &Fill) -> Option<LayoutRow> {
452
452
..TextLabel :: default ( )
453
453
} ) ) ,
454
454
WidgetHolder :: new( Widget :: Separator ( Separator {
455
- separator_type: SeparatorType :: Related ,
455
+ separator_type: SeparatorType :: Unrelated ,
456
456
direction: SeparatorDirection :: Horizontal ,
457
457
} ) ) ,
458
458
WidgetHolder :: new( Widget :: ColorInput ( ColorInput {
459
459
value: gradient_1. positions[ 0 ] . 1 . rgba_hex( ) ,
460
460
on_update: WidgetCallback :: new( move |text_input: & ColorInput | {
461
- if let Some ( color) = Color :: from_rgba_str( & text_input. value) . or ( Color :: from_rgb_str( & text_input. value) ) {
461
+ if let Some ( color) = Color :: from_rgba_str( & text_input. value) . or_else ( || Color :: from_rgb_str( & text_input. value) ) {
462
462
let mut new_gradient = ( * gradient_1) . clone( ) ;
463
463
new_gradient. positions[ 0 ] . 1 = color;
464
464
PropertiesPanelMessage :: ModifyFill {
@@ -480,13 +480,13 @@ fn node_section_fill(fill: &Fill) -> Option<LayoutRow> {
480
480
..TextLabel :: default ( )
481
481
} ) ) ,
482
482
WidgetHolder :: new( Widget :: Separator ( Separator {
483
- separator_type: SeparatorType :: Related ,
483
+ separator_type: SeparatorType :: Unrelated ,
484
484
direction: SeparatorDirection :: Horizontal ,
485
485
} ) ) ,
486
486
WidgetHolder :: new( Widget :: ColorInput ( ColorInput {
487
487
value: gradient_2. positions[ 1 ] . 1 . rgba_hex( ) ,
488
488
on_update: WidgetCallback :: new( move |text_input: & ColorInput | {
489
- if let Some ( color) = Color :: from_rgba_str( & text_input. value) . or ( Color :: from_rgb_str( & text_input. value) ) {
489
+ if let Some ( color) = Color :: from_rgba_str( & text_input. value) . or_else ( || Color :: from_rgb_str( & text_input. value) ) {
490
490
let mut new_gradient = ( * gradient_2) . clone( ) ;
491
491
new_gradient. positions[ 1 ] . 1 = color;
492
492
PropertiesPanelMessage :: ModifyFill {
@@ -521,7 +521,7 @@ fn node_section_stroke(stroke: &Stroke) -> LayoutRow {
521
521
..TextLabel :: default ( )
522
522
} ) ) ,
523
523
WidgetHolder :: new( Widget :: Separator ( Separator {
524
- separator_type: SeparatorType :: Related ,
524
+ separator_type: SeparatorType :: Unrelated ,
525
525
direction: SeparatorDirection :: Horizontal ,
526
526
} ) ) ,
527
527
WidgetHolder :: new( Widget :: ColorInput ( ColorInput {
@@ -544,7 +544,7 @@ fn node_section_stroke(stroke: &Stroke) -> LayoutRow {
544
544
..TextLabel :: default ( )
545
545
} ) ) ,
546
546
WidgetHolder :: new( Widget :: Separator ( Separator {
547
- separator_type: SeparatorType :: Related ,
547
+ separator_type: SeparatorType :: Unrelated ,
548
548
direction: SeparatorDirection :: Horizontal ,
549
549
} ) ) ,
550
550
WidgetHolder :: new( Widget :: NumberInput ( NumberInput {
0 commit comments