Many subtle improvements to the UI design system (#1537)

This commit is contained in:
Keavon Chambers
2023-12-28 04:35:20 -08:00
committed by GitHub
parent 34f952bad1
commit 96b5d7b520
62 changed files with 326 additions and 521 deletions
@@ -141,7 +141,7 @@ impl LayoutHolder for BrushTool {
.widget_holder(),
];
widgets.push(Separator::new(SeparatorType::Section).widget_holder());
widgets.push(Separator::new(SeparatorType::Unrelated).widget_holder());
let draw_mode_entries: Vec<_> = [DrawMode::Draw, DrawMode::Erase, DrawMode::Restore]
.into_iter()
@@ -149,7 +149,7 @@ impl LayoutHolder for BrushTool {
.collect();
widgets.push(RadioInput::new(draw_mode_entries).selected_index(Some(self.options.draw_mode as u32)).widget_holder());
widgets.push(Separator::new(SeparatorType::Section).widget_holder());
widgets.push(Separator::new(SeparatorType::Unrelated).widget_holder());
widgets.append(&mut self.options.color.create_widgets(
"Color",
@@ -96,7 +96,7 @@ impl LayoutHolder for EllipseTool {
|color: &ColorButton| EllipseToolMessage::UpdateOptions(EllipseOptionsUpdate::FillColor(color.value)).into(),
);
widgets.push(Separator::new(SeparatorType::Section).widget_holder());
widgets.push(Separator::new(SeparatorType::Unrelated).widget_holder());
widgets.append(&mut self.options.stroke.create_widgets(
"Stroke",
@@ -103,7 +103,7 @@ impl LayoutHolder for FreehandTool {
|color: &ColorButton| FreehandToolMessage::UpdateOptions(FreehandOptionsUpdate::FillColor(color.value)).into(),
);
widgets.push(Separator::new(SeparatorType::Section).widget_holder());
widgets.push(Separator::new(SeparatorType::Unrelated).widget_holder());
widgets.append(&mut self.options.stroke.create_widgets(
"Stroke",
@@ -118,7 +118,7 @@ impl LayoutHolder for PenTool {
|color: &ColorButton| PenToolMessage::UpdateOptions(PenOptionsUpdate::FillColor(color.value)).into(),
);
widgets.push(Separator::new(SeparatorType::Section).widget_holder());
widgets.push(Separator::new(SeparatorType::Unrelated).widget_holder());
widgets.append(&mut self.options.stroke.create_widgets(
"Stroke",
@@ -125,7 +125,7 @@ impl LayoutHolder for PolygonTool {
create_sides_widget(self.options.vertices),
];
widgets.push(Separator::new(SeparatorType::Section).widget_holder());
widgets.push(Separator::new(SeparatorType::Unrelated).widget_holder());
widgets.append(&mut self.options.fill.create_widgets(
"Fill",
@@ -135,7 +135,7 @@ impl LayoutHolder for PolygonTool {
|color: &ColorButton| PolygonToolMessage::UpdateOptions(PolygonOptionsUpdate::FillColor(color.value)).into(),
));
widgets.push(Separator::new(SeparatorType::Section).widget_holder());
widgets.push(Separator::new(SeparatorType::Unrelated).widget_holder());
widgets.append(&mut self.options.stroke.create_widgets(
"Stroke",
@@ -84,7 +84,7 @@ impl LayoutHolder for RectangleTool {
|color: &ColorButton| RectangleToolMessage::UpdateOptions(RectangleOptionsUpdate::FillColor(color.value)).into(),
);
widgets.push(Separator::new(SeparatorType::Section).widget_holder());
widgets.push(Separator::new(SeparatorType::Unrelated).widget_holder());
widgets.append(&mut self.options.stroke.create_widgets(
"Stroke",
@@ -175,23 +175,20 @@ impl LayoutHolder for SelectTool {
// Align
let disabled = self.tool_data.selected_layers_count < 2;
widgets.push(Separator::new(SeparatorType::Section).widget_holder());
widgets.push(Separator::new(SeparatorType::Unrelated).widget_holder());
widgets.extend(self.alignment_widgets(disabled));
widgets.push(Separator::new(SeparatorType::Related).widget_holder());
widgets.push(PopoverButton::new("Align", "Coming soon").disabled(disabled).widget_holder());
// Flip
let disabled = self.tool_data.selected_layers_count == 0;
widgets.push(Separator::new(SeparatorType::Section).widget_holder());
widgets.push(Separator::new(SeparatorType::Unrelated).widget_holder());
widgets.extend(self.flip_widgets(disabled));
widgets.push(Separator::new(SeparatorType::Related).widget_holder());
widgets.push(PopoverButton::new("Flip", "Coming soon").disabled(disabled).widget_holder());
// Boolean
if self.tool_data.selected_layers_count >= 2 {
widgets.push(Separator::new(SeparatorType::Section).widget_holder());
widgets.push(Separator::new(SeparatorType::Unrelated).widget_holder());
widgets.extend(self.boolean_widgets());
widgets.push(Separator::new(SeparatorType::Related).widget_holder());
widgets.push(PopoverButton::new("Boolean", "Coming soon").widget_holder());
}
@@ -105,7 +105,7 @@ impl LayoutHolder for SplineTool {
|color: &ColorButton| SplineToolMessage::UpdateOptions(SplineOptionsUpdate::FillColor(color.value)).into(),
);
widgets.push(Separator::new(SeparatorType::Section).widget_holder());
widgets.push(Separator::new(SeparatorType::Unrelated).widget_holder());
widgets.append(&mut self.options.stroke.create_widgets(
"Stroke",
@@ -130,7 +130,7 @@ impl LayoutHolder for TextTool {
fn layout(&self) -> Layout {
let mut widgets = create_text_widgets(self);
widgets.push(Separator::new(SeparatorType::Section).widget_holder());
widgets.push(Separator::new(SeparatorType::Unrelated).widget_holder());
widgets.append(&mut self.options.fill.create_widgets(
"Fill",
+1 -1
View File
@@ -138,7 +138,7 @@ impl DocumentToolData {
pub fn update_working_colors(&self, responses: &mut VecDeque<Message>) {
let layout = WidgetLayout::new(vec![
LayoutGroup::Row {
widgets: vec![WorkingColorsButton::new(self.primary_color, self.secondary_color).widget_holder()],
widgets: vec![WorkingColorsInput::new(self.primary_color, self.secondary_color).widget_holder()],
},
LayoutGroup::Row {
widgets: vec![