Skip to content

Commit 9e1d803

Browse files
committed
editor: update grid_overlays to fix issues caused by external
refactoring (widget_holder → widget_instance, SeparatorType → SeparatorStyle)
1 parent 76c4c89 commit 9e1d803

File tree

1 file changed

+31
-30
lines changed

1 file changed

+31
-30
lines changed

editor/src/messages/portfolio/document/overlays/grid_overlays.rs

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -331,30 +331,31 @@ pub fn overlay_options(grid: &GridSnapping) -> Vec<LayoutGroup> {
331331
widgets.push(LayoutGroup::Row {
332332
widgets: vec![TextLabel::new("Grid").bold(true).widget_instance()],
333333
});
334-
let mut color_widgets = vec![TextLabel::new("Color").table_align(true).widget_holder(), Separator::new(SeparatorType::Unrelated).widget_holder()];
334+
let mut color_widgets = vec![TextLabel::new("Color").table_align(true).widget_instance(), Separator::new(SeparatorStyle::Unrelated).widget_instance() ];
335335
color_widgets.push(
336336
ColorInput::new(FillChoice::Solid(grid.grid_color.to_gamma_srgb()))
337-
.tooltip("Grid display color")
337+
.tooltip_label("Grid display color")
338338
.allow_none(false)
339339
.on_update(update_color(grid, |grid| Some(&mut grid.grid_color)))
340-
.widget_holder(),
340+
.widget_instance()
341+
,
341342
);
342343
if grid.has_minor_lines() {
343-
color_widgets.push(Separator::new(SeparatorType::Related).widget_holder());
344+
color_widgets.push(Separator::new(SeparatorStyle::Related).widget_instance());
344345
color_widgets.push(
345346
ColorInput::new(FillChoice::Solid(grid.grid_color_minor.to_gamma_srgb()))
346-
.tooltip("Minor grid line display color")
347+
.tooltip_label("Minor grid line display color")
347348
.allow_none(false)
348349
.on_update(update_color(grid, |grid| Some(&mut grid.grid_color_minor)))
349-
.widget_holder(),
350+
.widget_instance(),
350351
);
351352
}
352353
widgets.push(LayoutGroup::Row { widgets: color_widgets });
353354

354355
widgets.push(LayoutGroup::Row {
355356
widgets: vec![
356-
TextLabel::new("Display").table_align(true).widget_holder(),
357-
Separator::new(SeparatorType::Unrelated).widget_holder(),
357+
TextLabel::new("Display").table_align(true).widget_instance(),
358+
Separator::new(SeparatorStyle::Unrelated).widget_instance(),
358359
RadioInput::new(vec![
359360
RadioEntryData::new("small").icon("Dot").on_update(update_val(grid, |grid, _| {
360361
grid.major_is_thick = false;
@@ -364,8 +365,8 @@ pub fn overlay_options(grid: &GridSnapping) -> Vec<LayoutGroup> {
364365
})),
365366
])
366367
.selected_index(Some(if grid.major_is_thick { 1 } else { 0 }))
367-
.widget_holder(),
368-
Separator::new(SeparatorType::Related).widget_holder(),
368+
.widget_instance(),
369+
Separator::new(SeparatorStyle::Related).widget_instance(),
369370
RadioInput::new(vec![
370371
RadioEntryData::new("lines").label("Lines").icon("Grid").on_update(update_val(grid, |grid, _| {
371372
grid.dot_display = false;
@@ -376,13 +377,13 @@ pub fn overlay_options(grid: &GridSnapping) -> Vec<LayoutGroup> {
376377
])
377378
// .min_width(200)
378379
.selected_index(Some(if grid.dot_display { 1 } else { 0 }))
379-
.widget_holder(),
380+
.widget_instance(),
380381
],
381382
});
382383
widgets.push(LayoutGroup::Row {
383384
widgets: vec![
384-
TextLabel::new("Type").table_align(true).widget_holder(),
385-
Separator::new(SeparatorType::Unrelated).widget_holder(),
385+
TextLabel::new("Type").table_align(true).widget_instance(),
386+
Separator::new(SeparatorStyle::Unrelated).widget_instance(),
386387
RadioInput::new(vec![
387388
RadioEntryData::new("rectangular").label("Rectangular").on_update(update_val(grid, |grid, _| {
388389
if let GridType::Isometric { y_axis_spacing, angle_a, angle_b } = grid.grid_type {
@@ -436,29 +437,29 @@ pub fn overlay_options(grid: &GridSnapping) -> Vec<LayoutGroup> {
436437
GridType::Rectangular { spacing, .. } => {
437438
widgets.push(LayoutGroup::Row {
438439
widgets: vec![
439-
TextLabel::new("Spacing").table_align(true).widget_holder(),
440-
Separator::new(SeparatorType::Unrelated).widget_holder(),
440+
TextLabel::new("Spacing").table_align(true).widget_instance(),
441+
Separator::new(SeparatorStyle::Unrelated).widget_instance(),
441442
NumberInput::new(Some(spacing.x))
442443
.label("X")
443444
.unit(" px")
444445
.min(0.)
445446
.min_width(98)
446447
.on_update(update_origin(grid, |grid| grid.grid_type.rectangular_spacing().map(|spacing| &mut spacing.x)))
447-
.widget_holder(),
448-
Separator::new(SeparatorType::Related).widget_holder(),
448+
.widget_instance(),
449+
Separator::new(SeparatorStyle::Related).widget_instance(),
449450
NumberInput::new(Some(spacing.y))
450451
.label("Y")
451452
.unit(" px")
452453
.min(0.)
453454
.min_width(98)
454455
.on_update(update_origin(grid, |grid| grid.grid_type.rectangular_spacing().map(|spacing| &mut spacing.y)))
455-
.widget_holder(),
456+
.widget_instance(),
456457
],
457458
});
458459
widgets.push(LayoutGroup::Row {
459460
widgets: vec![
460-
TextLabel::new("Mark Every").table_align(true).widget_holder(),
461-
Separator::new(SeparatorType::Unrelated).widget_holder(),
461+
TextLabel::new("Mark Every").table_align(true).widget_instance(),
462+
Separator::new(SeparatorStyle::Unrelated).widget_instance(),
462463
NumberInput::new(Some(grid.rectangular_major_interval.x as f64))
463464
.unit(" col")
464465
.int()
@@ -469,8 +470,8 @@ pub fn overlay_options(grid: &GridSnapping) -> Vec<LayoutGroup> {
469470
grid.rectangular_major_interval.x = val as u32;
470471
}
471472
}))
472-
.widget_holder(),
473-
Separator::new(SeparatorType::Related).widget_holder(),
473+
.widget_instance(),
474+
Separator::new(SeparatorStyle::Related).widget_instance(),
474475
NumberInput::new(Some(grid.rectangular_major_interval.y as f64))
475476
.unit(" row")
476477
.int()
@@ -481,7 +482,7 @@ pub fn overlay_options(grid: &GridSnapping) -> Vec<LayoutGroup> {
481482
grid.rectangular_major_interval.y = val as u32;
482483
}
483484
}))
484-
.widget_holder(),
485+
.widget_instance(),
485486
],
486487
});
487488
}
@@ -519,8 +520,8 @@ pub fn overlay_options(grid: &GridSnapping) -> Vec<LayoutGroup> {
519520
});
520521
widgets.push(LayoutGroup::Row {
521522
widgets: vec![
522-
TextLabel::new("Mark Every").table_align(true).widget_holder(),
523-
Separator::new(SeparatorType::Unrelated).widget_holder(),
523+
TextLabel::new("Mark Every").table_align(true).widget_instance(),
524+
Separator::new(SeparatorStyle::Unrelated).widget_instance(),
524525
NumberInput::new(Some(grid.isometric_major_interval.x as f64))
525526
.label("X")
526527
.int()
@@ -531,8 +532,8 @@ pub fn overlay_options(grid: &GridSnapping) -> Vec<LayoutGroup> {
531532
grid.isometric_major_interval.x = val as u32;
532533
}
533534
}))
534-
.widget_holder(),
535-
Separator::new(SeparatorType::Related).widget_holder(),
535+
.widget_instance(),
536+
Separator::new(SeparatorStyle::Related).widget_instance(),
536537
NumberInput::new(Some(grid.isometric_major_interval.y as f64))
537538
.label("B")
538539
.int()
@@ -543,8 +544,8 @@ pub fn overlay_options(grid: &GridSnapping) -> Vec<LayoutGroup> {
543544
grid.isometric_major_interval.y = val as u32;
544545
}
545546
}))
546-
.widget_holder(),
547-
Separator::new(SeparatorType::Related).widget_holder(),
547+
.widget_instance(),
548+
Separator::new(SeparatorStyle::Related).widget_instance(),
548549
NumberInput::new(Some(grid.isometric_major_interval.z as f64))
549550
.label("A")
550551
.int()
@@ -555,7 +556,7 @@ pub fn overlay_options(grid: &GridSnapping) -> Vec<LayoutGroup> {
555556
grid.isometric_major_interval.z = val as u32;
556557
}
557558
}))
558-
.widget_holder(),
559+
.widget_instance(),
559560
],
560561
});
561562
}

0 commit comments

Comments
 (0)