mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-28 11:08:12 +08:00
Unwrap the Layout enum to replace it with the WidgetLayout struct now called Layout (#3448)
This commit is contained in:
@@ -75,7 +75,7 @@ impl<'a> MessageHandler<ToolMessage, &mut ToolActionMessageContext<'a>> for Artb
|
||||
|
||||
impl LayoutHolder for ArtboardTool {
|
||||
fn layout(&self) -> Layout {
|
||||
Layout::WidgetLayout(WidgetLayout::default())
|
||||
Layout::default()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ impl LayoutHolder for BrushTool {
|
||||
.widget_instance(),
|
||||
);
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout(vec![LayoutGroup::Row { widgets }]))
|
||||
Layout(vec![LayoutGroup::Row { widgets }])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ impl ToolMetadata for EyedropperTool {
|
||||
|
||||
impl LayoutHolder for EyedropperTool {
|
||||
fn layout(&self) -> Layout {
|
||||
Layout::WidgetLayout(WidgetLayout::default())
|
||||
Layout::default()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ impl ToolMetadata for FillTool {
|
||||
|
||||
impl LayoutHolder for FillTool {
|
||||
fn layout(&self) -> Layout {
|
||||
Layout::WidgetLayout(WidgetLayout::default())
|
||||
Layout::default()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ impl LayoutHolder for FreehandTool {
|
||||
widgets.push(Separator::new(SeparatorType::Unrelated).widget_instance());
|
||||
widgets.push(create_weight_widget(self.options.line_weight));
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout(vec![LayoutGroup::Row { widgets }]))
|
||||
Layout(vec![LayoutGroup::Row { widgets }])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ impl LayoutHolder for GradientTool {
|
||||
.selected_index(Some((self.selected_gradient().unwrap_or(self.options.gradient_type) == GradientType::Radial) as u32))
|
||||
.widget_instance();
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout(vec![LayoutGroup::Row { widgets: vec![gradient_type] }]))
|
||||
Layout(vec![LayoutGroup::Row { widgets: vec![gradient_type] }])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ impl ToolMetadata for NavigateTool {
|
||||
|
||||
impl LayoutHolder for NavigateTool {
|
||||
fn layout(&self) -> Layout {
|
||||
Layout::WidgetLayout(WidgetLayout::default())
|
||||
Layout::default()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -342,7 +342,7 @@ impl LayoutHolder for PathTool {
|
||||
|
||||
let _pin_pivot = pin_pivot_widget(self.tool_data.pivot_gizmo.pin_active(), false, PivotToolSource::Path);
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout(vec![LayoutGroup::Row {
|
||||
Layout(vec![LayoutGroup::Row {
|
||||
widgets: vec![
|
||||
x_location,
|
||||
related_seperator.clone(),
|
||||
@@ -367,7 +367,7 @@ impl LayoutHolder for PathTool {
|
||||
// related_seperator.clone(),
|
||||
// pin_pivot,
|
||||
],
|
||||
}]))
|
||||
}])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -238,7 +238,7 @@ impl LayoutHolder for PenTool {
|
||||
.widget_instance(),
|
||||
);
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout(vec![LayoutGroup::Row { widgets }]))
|
||||
Layout(vec![LayoutGroup::Row { widgets }])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -252,7 +252,7 @@ impl LayoutHolder for SelectTool {
|
||||
widgets.extend(self.alignment_widgets(disabled));
|
||||
// widgets.push(
|
||||
// PopoverButton::new()
|
||||
// .popover_layout(WidgetLayout(vec![
|
||||
// .popover_layout(Layout(vec![
|
||||
// LayoutGroup::Row {
|
||||
// widgets: vec![TextLabel::new("Align").bold(true).widget_instance()],
|
||||
// },
|
||||
@@ -277,7 +277,7 @@ impl LayoutHolder for SelectTool {
|
||||
widgets.push(Separator::new(SeparatorType::Unrelated).widget_instance());
|
||||
widgets.extend(self.boolean_widgets(self.tool_data.selected_layers_count));
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout(vec![LayoutGroup::Row { widgets }]))
|
||||
Layout(vec![LayoutGroup::Row { widgets }])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -335,7 +335,7 @@ impl LayoutHolder for ShapeTool {
|
||||
widgets.push(Separator::new(SeparatorType::Unrelated).widget_instance());
|
||||
widgets.push(create_weight_widget(self.options.line_weight));
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout(vec![LayoutGroup::Row { widgets }]))
|
||||
Layout(vec![LayoutGroup::Row { widgets }])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ impl LayoutHolder for SplineTool {
|
||||
widgets.push(Separator::new(SeparatorType::Unrelated).widget_instance());
|
||||
widgets.push(create_weight_widget(self.options.line_weight));
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout(vec![LayoutGroup::Row { widgets }]))
|
||||
Layout(vec![LayoutGroup::Row { widgets }])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ impl LayoutHolder for TextTool {
|
||||
},
|
||||
));
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout(vec![LayoutGroup::Row { widgets }]))
|
||||
Layout(vec![LayoutGroup::Row { widgets }])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ pub struct DocumentToolData {
|
||||
|
||||
impl DocumentToolData {
|
||||
pub fn update_working_colors(&self, responses: &mut VecDeque<Message>) {
|
||||
let layout = WidgetLayout(vec![
|
||||
let layout = Layout(vec![
|
||||
LayoutGroup::Row {
|
||||
widgets: vec![WorkingColorsInput::new(self.primary_color.to_gamma_srgb(), self.secondary_color.to_gamma_srgb()).widget_instance()],
|
||||
},
|
||||
@@ -138,7 +138,7 @@ impl DocumentToolData {
|
||||
]);
|
||||
|
||||
responses.add(LayoutMessage::SendLayout {
|
||||
layout: Layout::WidgetLayout(layout),
|
||||
layout,
|
||||
layout_target: LayoutTarget::WorkingColors,
|
||||
});
|
||||
|
||||
@@ -290,7 +290,7 @@ impl LayoutHolder for ToolData {
|
||||
.skip(1)
|
||||
.collect();
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout(vec![LayoutGroup::Row { widgets: tool_groups_layout }]))
|
||||
Layout(vec![LayoutGroup::Row { widgets: tool_groups_layout }])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -545,7 +545,7 @@ impl HintData {
|
||||
}
|
||||
}
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout(vec![LayoutGroup::Row { widgets }]))
|
||||
Layout(vec![LayoutGroup::Row { widgets }])
|
||||
}
|
||||
|
||||
pub fn send_layout(&self, responses: &mut VecDeque<Message>) {
|
||||
@@ -557,7 +557,7 @@ impl HintData {
|
||||
|
||||
pub fn clear_layout(responses: &mut VecDeque<Message>) {
|
||||
responses.add(LayoutMessage::SendLayout {
|
||||
layout: Layout::WidgetLayout(WidgetLayout(vec![])),
|
||||
layout: Layout::default(),
|
||||
layout_target: LayoutTarget::StatusBarHints,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user