mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-02 09:38:11 +08:00
Rename WidgetHolder to WidgetInstance
This commit is contained in:
@@ -72,8 +72,8 @@ impl DialogLayoutHolder for ExportDialogMessageHandler {
|
||||
}
|
||||
.into()
|
||||
})
|
||||
.widget_holder(),
|
||||
TextButton::new("Cancel").on_update(|_| FrontendMessage::DisplayDialogDismiss.into()).widget_holder(),
|
||||
.widget_instance(),
|
||||
TextButton::new("Cancel").on_update(|_| FrontendMessage::DisplayDialogDismiss.into()).widget_instance(),
|
||||
];
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout::new(vec![LayoutGroup::Row { widgets }]))
|
||||
@@ -92,14 +92,14 @@ impl LayoutHolder for ExportDialogMessageHandler {
|
||||
.collect();
|
||||
|
||||
let export_type = vec![
|
||||
TextLabel::new("File Type").table_align(true).min_width("100px").widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
RadioInput::new(entries).selected_index(Some(self.file_type as u32)).widget_holder(),
|
||||
TextLabel::new("File Type").table_align(true).min_width("100px").widget_instance(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
RadioInput::new(entries).selected_index(Some(self.file_type as u32)).widget_instance(),
|
||||
];
|
||||
|
||||
let resolution = vec![
|
||||
TextLabel::new("Scale Factor").table_align(true).min_width("100px").widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
TextLabel::new("Scale Factor").table_align(true).min_width("100px").widget_instance(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
NumberInput::new(Some(self.scale_factor))
|
||||
.unit("")
|
||||
.min(0.)
|
||||
@@ -107,7 +107,7 @@ impl LayoutHolder for ExportDialogMessageHandler {
|
||||
.disabled(self.file_type == FileType::Svg)
|
||||
.on_update(|number_input: &NumberInput| ExportDialogMessage::ScaleFactor { factor: number_input.value.unwrap() }.into())
|
||||
.min_width(200)
|
||||
.widget_holder(),
|
||||
.widget_instance(),
|
||||
];
|
||||
|
||||
let standard_bounds = vec![
|
||||
@@ -144,20 +144,20 @@ impl LayoutHolder for ExportDialogMessageHandler {
|
||||
}
|
||||
|
||||
let export_area = vec![
|
||||
TextLabel::new("Bounds").table_align(true).min_width("100px").widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
DropdownInput::new(entries).selected_index(Some(index as u32)).widget_holder(),
|
||||
TextLabel::new("Bounds").table_align(true).min_width("100px").widget_instance(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
DropdownInput::new(entries).selected_index(Some(index as u32)).widget_instance(),
|
||||
];
|
||||
|
||||
let checkbox_id = CheckboxId::new();
|
||||
let transparent_background = vec![
|
||||
TextLabel::new("Transparency").table_align(true).min_width("100px").for_checkbox(checkbox_id).widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
TextLabel::new("Transparency").table_align(true).min_width("100px").for_checkbox(checkbox_id).widget_instance(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
CheckboxInput::new(self.transparent_background)
|
||||
.disabled(self.file_type == FileType::Jpg)
|
||||
.on_update(move |value: &CheckboxInput| ExportDialogMessage::TransparentBackground { transparent: value.checked }.into())
|
||||
.for_label(checkbox_id)
|
||||
.widget_holder(),
|
||||
.widget_instance(),
|
||||
];
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout::new(vec![
|
||||
|
||||
+13
-13
@@ -62,8 +62,8 @@ impl DialogLayoutHolder for NewDocumentDialogMessageHandler {
|
||||
}
|
||||
.into()
|
||||
})
|
||||
.widget_holder(),
|
||||
TextButton::new("Cancel").on_update(|_| FrontendMessage::DisplayDialogDismiss.into()).widget_holder(),
|
||||
.widget_instance(),
|
||||
TextButton::new("Cancel").on_update(|_| FrontendMessage::DisplayDialogDismiss.into()).widget_instance(),
|
||||
];
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout::new(vec![LayoutGroup::Row { widgets }]))
|
||||
@@ -73,27 +73,27 @@ impl DialogLayoutHolder for NewDocumentDialogMessageHandler {
|
||||
impl LayoutHolder for NewDocumentDialogMessageHandler {
|
||||
fn layout(&self) -> Layout {
|
||||
let name = vec![
|
||||
TextLabel::new("Name").table_align(true).min_width("90px").widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
TextLabel::new("Name").table_align(true).min_width("90px").widget_instance(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
TextInput::new(&self.name)
|
||||
.on_update(|text_input: &TextInput| NewDocumentDialogMessage::Name { name: text_input.value.clone() }.into())
|
||||
.min_width(204) // Matches the 100px of both NumberInputs below + the 4px of the Unrelated-type separator
|
||||
.widget_holder(),
|
||||
.widget_instance(),
|
||||
];
|
||||
|
||||
let checkbox_id = CheckboxId::new();
|
||||
let infinite = vec![
|
||||
TextLabel::new("Infinite Canvas").table_align(true).min_width("90px").for_checkbox(checkbox_id).widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
TextLabel::new("Infinite Canvas").table_align(true).min_width("90px").for_checkbox(checkbox_id).widget_instance(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
CheckboxInput::new(self.infinite)
|
||||
.on_update(|checkbox_input: &CheckboxInput| NewDocumentDialogMessage::Infinite { infinite: checkbox_input.checked }.into())
|
||||
.for_label(checkbox_id)
|
||||
.widget_holder(),
|
||||
.widget_instance(),
|
||||
];
|
||||
|
||||
let scale = vec![
|
||||
TextLabel::new("Dimensions").table_align(true).min_width("90px").widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
TextLabel::new("Dimensions").table_align(true).min_width("90px").widget_instance(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
NumberInput::new(Some(self.dimensions.x as f64))
|
||||
.label("W")
|
||||
.unit(" px")
|
||||
@@ -103,8 +103,8 @@ impl LayoutHolder for NewDocumentDialogMessageHandler {
|
||||
.disabled(self.infinite)
|
||||
.min_width(100)
|
||||
.on_update(|number_input: &NumberInput| NewDocumentDialogMessage::DimensionsX { width: number_input.value.unwrap() }.into())
|
||||
.widget_holder(),
|
||||
Separator::new(SeparatorType::Related).widget_holder(),
|
||||
.widget_instance(),
|
||||
Separator::new(SeparatorType::Related).widget_instance(),
|
||||
NumberInput::new(Some(self.dimensions.y as f64))
|
||||
.label("H")
|
||||
.unit(" px")
|
||||
@@ -114,7 +114,7 @@ impl LayoutHolder for NewDocumentDialogMessageHandler {
|
||||
.disabled(self.infinite)
|
||||
.min_width(100)
|
||||
.on_update(|number_input: &NumberInput| NewDocumentDialogMessage::DimensionsY { height: number_input.value.unwrap() }.into())
|
||||
.widget_holder(),
|
||||
.widget_instance(),
|
||||
];
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout::new(vec![
|
||||
|
||||
+35
-35
@@ -40,17 +40,17 @@ impl PreferencesDialogMessageHandler {
|
||||
// NAVIGATION
|
||||
// ==========
|
||||
|
||||
let navigation_header = vec![TextLabel::new("Navigation").italic(true).widget_holder()];
|
||||
let navigation_header = vec![TextLabel::new("Navigation").italic(true).widget_instance()];
|
||||
|
||||
let zoom_rate_description = "Adjust how fast zooming occurs when using the scroll wheel or pinch gesture (relative to a default of 50).";
|
||||
let zoom_rate_label = vec![
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
TextLabel::new("Zoom Rate").tooltip_label("Zoom Rate").tooltip_description(zoom_rate_description).widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
TextLabel::new("Zoom Rate").tooltip_label("Zoom Rate").tooltip_description(zoom_rate_description).widget_instance(),
|
||||
];
|
||||
let zoom_rate = vec![
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
NumberInput::new(Some(map_zoom_rate_to_display(preferences.viewport_zoom_wheel_rate)))
|
||||
.tooltip_label("Zoom Rate")
|
||||
.tooltip_description(zoom_rate_description)
|
||||
@@ -66,14 +66,14 @@ impl PreferencesDialogMessageHandler {
|
||||
PreferencesMessage::ViewportZoomWheelRate { rate: VIEWPORT_ZOOM_WHEEL_RATE }.into()
|
||||
}
|
||||
})
|
||||
.widget_holder(),
|
||||
.widget_instance(),
|
||||
];
|
||||
|
||||
let checkbox_id = CheckboxId::new();
|
||||
let zoom_with_scroll_description = "Use the scroll wheel for zooming instead of vertically panning (not recommended for trackpads).";
|
||||
let zoom_with_scroll = vec![
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
CheckboxInput::new(preferences.zoom_with_scroll)
|
||||
.tooltip_label("Zoom with Scroll")
|
||||
.tooltip_description(zoom_with_scroll_description)
|
||||
@@ -84,25 +84,25 @@ impl PreferencesDialogMessageHandler {
|
||||
.into()
|
||||
})
|
||||
.for_label(checkbox_id)
|
||||
.widget_holder(),
|
||||
.widget_instance(),
|
||||
TextLabel::new("Zoom with Scroll")
|
||||
.tooltip_label("Zoom with Scroll")
|
||||
.tooltip_description(zoom_with_scroll_description)
|
||||
.for_checkbox(checkbox_id)
|
||||
.table_align(true)
|
||||
.widget_holder(),
|
||||
.widget_instance(),
|
||||
];
|
||||
|
||||
// =======
|
||||
// EDITING
|
||||
// =======
|
||||
|
||||
let editing_header = vec![TextLabel::new("Editing").italic(true).widget_holder()];
|
||||
let editing_header = vec![TextLabel::new("Editing").italic(true).widget_instance()];
|
||||
|
||||
let selection_label = vec![
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
TextLabel::new("Selection").widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
TextLabel::new("Selection").widget_instance(),
|
||||
];
|
||||
|
||||
let selection_mode = RadioInput::new(vec![
|
||||
@@ -138,10 +138,10 @@ impl PreferencesDialogMessageHandler {
|
||||
}),
|
||||
])
|
||||
.selected_index(Some(preferences.selection_mode as u32))
|
||||
.widget_holder();
|
||||
.widget_instance();
|
||||
let selection_mode = vec![
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
selection_mode,
|
||||
];
|
||||
|
||||
@@ -149,16 +149,16 @@ impl PreferencesDialogMessageHandler {
|
||||
// EXPERIMENTAL
|
||||
// ============
|
||||
|
||||
let experimental_header = vec![TextLabel::new("Experimental").italic(true).widget_holder()];
|
||||
let experimental_header = vec![TextLabel::new("Experimental").italic(true).widget_instance()];
|
||||
|
||||
let node_graph_section_description = "Appearance of the wires running between node connections in the graph.";
|
||||
let node_graph_wires_label = vec![
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
TextLabel::new("Node Graph Wires")
|
||||
.tooltip_label("Node Graph Wires")
|
||||
.tooltip_description(node_graph_section_description)
|
||||
.widget_holder(),
|
||||
.widget_instance(),
|
||||
];
|
||||
let graph_wire_style = RadioInput::new(vec![
|
||||
RadioEntryData::new(GraphWireStyle::Direct.to_string())
|
||||
@@ -173,32 +173,32 @@ impl PreferencesDialogMessageHandler {
|
||||
.on_update(move |_| PreferencesMessage::GraphWireStyle { style: GraphWireStyle::GridAligned }.into()),
|
||||
])
|
||||
.selected_index(Some(preferences.graph_wire_style as u32))
|
||||
.widget_holder();
|
||||
.widget_instance();
|
||||
let graph_wire_style = vec![
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
graph_wire_style,
|
||||
];
|
||||
|
||||
let checkbox_id = CheckboxId::new();
|
||||
let vello_description = "Use the experimental Vello renderer. (Your browser must support WebGPU).";
|
||||
let use_vello = vec![
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
CheckboxInput::new(preferences.use_vello && preferences.supports_wgpu())
|
||||
.tooltip_label("Vello Renderer")
|
||||
.tooltip_description(vello_description)
|
||||
.disabled(!preferences.supports_wgpu())
|
||||
.on_update(|checkbox_input: &CheckboxInput| PreferencesMessage::UseVello { use_vello: checkbox_input.checked }.into())
|
||||
.for_label(checkbox_id)
|
||||
.widget_holder(),
|
||||
.widget_instance(),
|
||||
TextLabel::new("Vello Renderer")
|
||||
.tooltip_label("Vello Renderer")
|
||||
.tooltip_description(vello_description)
|
||||
.disabled(!preferences.supports_wgpu())
|
||||
.for_checkbox(checkbox_id)
|
||||
.table_align(true)
|
||||
.widget_holder(),
|
||||
.widget_instance(),
|
||||
];
|
||||
|
||||
let checkbox_id = CheckboxId::new();
|
||||
@@ -208,20 +208,20 @@ impl PreferencesDialogMessageHandler {
|
||||
"
|
||||
.trim();
|
||||
let vector_meshes = vec![
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
Separator::new(SeparatorType::Unrelated).widget_instance(),
|
||||
CheckboxInput::new(preferences.vector_meshes)
|
||||
.tooltip_label("Vector Meshes")
|
||||
.tooltip_description(vector_mesh_description)
|
||||
.on_update(|checkbox_input: &CheckboxInput| PreferencesMessage::VectorMeshes { enabled: checkbox_input.checked }.into())
|
||||
.for_label(checkbox_id)
|
||||
.widget_holder(),
|
||||
.widget_instance(),
|
||||
TextLabel::new("Vector Meshes")
|
||||
.tooltip_label("Vector Meshes")
|
||||
.tooltip_description(vector_mesh_description)
|
||||
.for_checkbox(checkbox_id)
|
||||
.table_align(true)
|
||||
.widget_holder(),
|
||||
.widget_instance(),
|
||||
];
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout::new(vec![
|
||||
@@ -268,8 +268,8 @@ impl PreferencesDialogMessageHandler {
|
||||
}
|
||||
.into()
|
||||
})
|
||||
.widget_holder(),
|
||||
TextButton::new("Reset to Defaults").on_update(|_| PreferencesMessage::ResetToDefaults.into()).widget_holder(),
|
||||
.widget_instance(),
|
||||
TextButton::new("Reset to Defaults").on_update(|_| PreferencesMessage::ResetToDefaults.into()).widget_instance(),
|
||||
];
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout::new(vec![LayoutGroup::Row { widgets }]))
|
||||
|
||||
@@ -13,7 +13,7 @@ impl DialogLayoutHolder for AboutGraphiteDialog {
|
||||
const TITLE: &'static str = "About Graphite";
|
||||
|
||||
fn layout_buttons(&self) -> Layout {
|
||||
let widgets = vec![TextButton::new("OK").emphasized(true).on_update(|_| FrontendMessage::DisplayDialogDismiss.into()).widget_holder()];
|
||||
let widgets = vec![TextButton::new("OK").emphasized(true).on_update(|_| FrontendMessage::DisplayDialogDismiss.into()).widget_instance()];
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout::new(vec![LayoutGroup::Row { widgets }]))
|
||||
}
|
||||
@@ -32,7 +32,7 @@ impl DialogLayoutHolder for AboutGraphiteDialog {
|
||||
.icon(Some(icon.into()))
|
||||
.flush(true)
|
||||
.on_update(|_| FrontendMessage::TriggerVisitLink { url: url.into() }.into())
|
||||
.widget_holder()
|
||||
.widget_instance()
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
@@ -48,7 +48,7 @@ impl DialogLayoutHolder for AboutGraphiteDialog {
|
||||
}
|
||||
.into()
|
||||
})
|
||||
.widget_holder(),
|
||||
.widget_instance(),
|
||||
);
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout::new(vec![LayoutGroup::Column { widgets }]))
|
||||
@@ -59,13 +59,13 @@ impl LayoutHolder for AboutGraphiteDialog {
|
||||
fn layout(&self) -> Layout {
|
||||
Layout::WidgetLayout(WidgetLayout::new(vec![
|
||||
LayoutGroup::Row {
|
||||
widgets: vec![TextLabel::new("About this release").bold(true).widget_holder()],
|
||||
widgets: vec![TextLabel::new("About this release").bold(true).widget_instance()],
|
||||
},
|
||||
LayoutGroup::Row {
|
||||
widgets: vec![TextLabel::new(commit_info_localized(&self.localized_commit_date)).multiline(true).widget_holder()],
|
||||
widgets: vec![TextLabel::new(commit_info_localized(&self.localized_commit_date)).multiline(true).widget_instance()],
|
||||
},
|
||||
LayoutGroup::Row {
|
||||
widgets: vec![TextLabel::new(format!("Copyright © {} Graphite contributors", self.localized_commit_year)).widget_holder()],
|
||||
widgets: vec![TextLabel::new(format!("Copyright © {} Graphite contributors", self.localized_commit_year)).widget_instance()],
|
||||
},
|
||||
]))
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ impl DialogLayoutHolder for CloseAllDocumentsDialog {
|
||||
}
|
||||
.into()
|
||||
})
|
||||
.widget_holder(),
|
||||
TextButton::new("Cancel").on_update(|_| FrontendMessage::DisplayDialogDismiss.into()).widget_holder(),
|
||||
.widget_instance(),
|
||||
TextButton::new("Cancel").on_update(|_| FrontendMessage::DisplayDialogDismiss.into()).widget_instance(),
|
||||
];
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout::new(vec![LayoutGroup::Row { widgets }]))
|
||||
@@ -34,10 +34,10 @@ impl LayoutHolder for CloseAllDocumentsDialog {
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout::new(vec![
|
||||
LayoutGroup::Row {
|
||||
widgets: vec![TextLabel::new("Save documents before closing them?").bold(true).multiline(true).widget_holder()],
|
||||
widgets: vec![TextLabel::new("Save documents before closing them?").bold(true).multiline(true).widget_instance()],
|
||||
},
|
||||
LayoutGroup::Row {
|
||||
widgets: vec![TextLabel::new(format!("Documents with unsaved changes:\n{unsaved_list}")).multiline(true).widget_holder()],
|
||||
widgets: vec![TextLabel::new(format!("Documents with unsaved changes:\n{unsaved_list}")).multiline(true).widget_instance()],
|
||||
},
|
||||
]))
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ impl DialogLayoutHolder for CloseDocumentDialog {
|
||||
}
|
||||
.into()
|
||||
})
|
||||
.widget_holder(),
|
||||
.widget_instance(),
|
||||
TextButton::new("Discard")
|
||||
.on_update(move |_| {
|
||||
DialogMessage::CloseDialogAndThen {
|
||||
@@ -31,8 +31,8 @@ impl DialogLayoutHolder for CloseDocumentDialog {
|
||||
}
|
||||
.into()
|
||||
})
|
||||
.widget_holder(),
|
||||
TextButton::new("Cancel").on_update(|_| FrontendMessage::DisplayDialogDismiss.into()).widget_holder(),
|
||||
.widget_instance(),
|
||||
TextButton::new("Cancel").on_update(|_| FrontendMessage::DisplayDialogDismiss.into()).widget_instance(),
|
||||
];
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout::new(vec![LayoutGroup::Row { widgets }]))
|
||||
@@ -53,10 +53,10 @@ impl LayoutHolder for CloseDocumentDialog {
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout::new(vec![
|
||||
LayoutGroup::Row {
|
||||
widgets: vec![TextLabel::new("Save document before closing it?").bold(true).widget_holder()],
|
||||
widgets: vec![TextLabel::new("Save document before closing it?").bold(true).widget_instance()],
|
||||
},
|
||||
LayoutGroup::Row {
|
||||
widgets: vec![TextLabel::new(format!("\"{name}{ellipsis}\"{break_lines}has unsaved changes")).multiline(true).widget_holder()],
|
||||
widgets: vec![TextLabel::new(format!("\"{name}{ellipsis}\"{break_lines}has unsaved changes")).multiline(true).widget_instance()],
|
||||
},
|
||||
]))
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ impl DialogLayoutHolder for ComingSoonDialog {
|
||||
const TITLE: &'static str = "Coming Soon";
|
||||
|
||||
fn layout_buttons(&self) -> Layout {
|
||||
let widgets = vec![TextButton::new("OK").emphasized(true).on_update(|_| FrontendMessage::DisplayDialogDismiss.into()).widget_holder()];
|
||||
let widgets = vec![TextButton::new("OK").emphasized(true).on_update(|_| FrontendMessage::DisplayDialogDismiss.into()).widget_instance()];
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout::new(vec![LayoutGroup::Row { widgets }]))
|
||||
}
|
||||
@@ -19,13 +19,13 @@ impl DialogLayoutHolder for ComingSoonDialog {
|
||||
|
||||
impl LayoutHolder for ComingSoonDialog {
|
||||
fn layout(&self) -> Layout {
|
||||
let header = vec![TextLabel::new("You've stumbled upon a placeholder").bold(true).widget_holder()];
|
||||
let row1 = vec![TextLabel::new("This feature is not implemented yet.").widget_holder()];
|
||||
let header = vec![TextLabel::new("You've stumbled upon a placeholder").bold(true).widget_instance()];
|
||||
let row1 = vec![TextLabel::new("This feature is not implemented yet.").widget_instance()];
|
||||
|
||||
let mut rows = vec![LayoutGroup::Row { widgets: header }, LayoutGroup::Row { widgets: row1 }];
|
||||
|
||||
if let Some(issue) = self.issue {
|
||||
let row2 = vec![TextLabel::new("But you can help build it! Visit its issue:").widget_holder()];
|
||||
let row2 = vec![TextLabel::new("But you can help build it! Visit its issue:").widget_instance()];
|
||||
let row3 = vec![
|
||||
TextButton::new(format!("GitHub Issue #{issue}"))
|
||||
.icon(Some("Website".into()))
|
||||
@@ -36,7 +36,7 @@ impl LayoutHolder for ComingSoonDialog {
|
||||
}
|
||||
.into()
|
||||
})
|
||||
.widget_holder(),
|
||||
.widget_instance(),
|
||||
];
|
||||
|
||||
rows.push(LayoutGroup::Row { widgets: row2 });
|
||||
|
||||
@@ -20,7 +20,7 @@ impl DialogLayoutHolder for DemoArtworkDialog {
|
||||
const TITLE: &'static str = "Demo Artwork";
|
||||
|
||||
fn layout_buttons(&self) -> Layout {
|
||||
let widgets = vec![TextButton::new("Close").emphasized(true).on_update(|_| FrontendMessage::DisplayDialogDismiss.into()).widget_holder()];
|
||||
let widgets = vec![TextButton::new("Close").emphasized(true).on_update(|_| FrontendMessage::DisplayDialogDismiss.into()).widget_instance()];
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout::new(vec![LayoutGroup::Row { widgets }]))
|
||||
}
|
||||
@@ -46,12 +46,12 @@ impl LayoutHolder for DemoArtworkDialog {
|
||||
|
||||
let images = chunk
|
||||
.iter()
|
||||
.map(|(name, thumbnail, filename)| ImageButton::new(*thumbnail).width(Some("256px".into())).on_update(|_| make_dialog(name, filename)).widget_holder())
|
||||
.map(|(name, thumbnail, filename)| ImageButton::new(*thumbnail).width(Some("256px".into())).on_update(|_| make_dialog(name, filename)).widget_instance())
|
||||
.collect();
|
||||
|
||||
let buttons = chunk
|
||||
.iter()
|
||||
.map(|(name, _, filename)| TextButton::new(*name).min_width(256).flush(true).on_update(|_| make_dialog(name, filename)).widget_holder())
|
||||
.map(|(name, _, filename)| TextButton::new(*name).min_width(256).flush(true).on_update(|_| make_dialog(name, filename)).widget_instance())
|
||||
.collect();
|
||||
|
||||
vec![LayoutGroup::Row { widgets: images }, LayoutGroup::Row { widgets: buttons }, LayoutGroup::Row { widgets: vec![] }]
|
||||
|
||||
@@ -12,7 +12,7 @@ impl DialogLayoutHolder for ErrorDialog {
|
||||
const TITLE: &'static str = "Error";
|
||||
|
||||
fn layout_buttons(&self) -> Layout {
|
||||
let widgets = vec![TextButton::new("OK").emphasized(true).on_update(|_| FrontendMessage::DisplayDialogDismiss.into()).widget_holder()];
|
||||
let widgets = vec![TextButton::new("OK").emphasized(true).on_update(|_| FrontendMessage::DisplayDialogDismiss.into()).widget_instance()];
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout::new(vec![LayoutGroup::Row { widgets }]))
|
||||
}
|
||||
@@ -22,10 +22,10 @@ impl LayoutHolder for ErrorDialog {
|
||||
fn layout(&self) -> Layout {
|
||||
Layout::WidgetLayout(WidgetLayout::new(vec![
|
||||
LayoutGroup::Row {
|
||||
widgets: vec![TextLabel::new(&self.title).bold(true).widget_holder()],
|
||||
widgets: vec![TextLabel::new(&self.title).bold(true).widget_instance()],
|
||||
},
|
||||
LayoutGroup::Row {
|
||||
widgets: vec![TextLabel::new(&self.description).multiline(true).widget_holder()],
|
||||
widgets: vec![TextLabel::new(&self.description).multiline(true).widget_instance()],
|
||||
},
|
||||
]))
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ impl DialogLayoutHolder for LicensesDialog {
|
||||
const TITLE: &'static str = "Licenses";
|
||||
|
||||
fn layout_buttons(&self) -> Layout {
|
||||
let widgets = vec![TextButton::new("OK").emphasized(true).on_update(|_| FrontendMessage::DisplayDialogDismiss.into()).widget_holder()];
|
||||
let widgets = vec![TextButton::new("OK").emphasized(true).on_update(|_| FrontendMessage::DisplayDialogDismiss.into()).widget_instance()];
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout::new(vec![LayoutGroup::Row { widgets }]))
|
||||
}
|
||||
@@ -40,7 +40,7 @@ impl DialogLayoutHolder for LicensesDialog {
|
||||
];
|
||||
let widgets = button_definitions
|
||||
.iter()
|
||||
.map(|&(icon, label, message_factory)| TextButton::new(label).icon(Some((icon).into())).flush(true).on_update(move |_| message_factory()).widget_holder())
|
||||
.map(|&(icon, label, message_factory)| TextButton::new(label).icon(Some((icon).into())).flush(true).on_update(move |_| message_factory()).widget_instance())
|
||||
.collect();
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout::new(vec![LayoutGroup::Column { widgets }]))
|
||||
@@ -65,10 +65,10 @@ impl LayoutHolder for LicensesDialog {
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout::new(vec![
|
||||
LayoutGroup::Row {
|
||||
widgets: vec![TextLabel::new("Graphite is free, open source software").bold(true).widget_holder()],
|
||||
widgets: vec![TextLabel::new("Graphite is free, open source software").bold(true).widget_instance()],
|
||||
},
|
||||
LayoutGroup::Row {
|
||||
widgets: vec![TextLabel::new(description).multiline(true).widget_holder()],
|
||||
widgets: vec![TextLabel::new(description).multiline(true).widget_instance()],
|
||||
},
|
||||
]))
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ impl DialogLayoutHolder for LicensesThirdPartyDialog {
|
||||
const TITLE: &'static str = "Third-Party Software License Notices";
|
||||
|
||||
fn layout_buttons(&self) -> Layout {
|
||||
let widgets = vec![TextButton::new("OK").emphasized(true).on_update(|_| FrontendMessage::DisplayDialogDismiss.into()).widget_holder()];
|
||||
let widgets = vec![TextButton::new("OK").emphasized(true).on_update(|_| FrontendMessage::DisplayDialogDismiss.into()).widget_instance()];
|
||||
|
||||
Layout::WidgetLayout(WidgetLayout::new(vec![LayoutGroup::Row { widgets }]))
|
||||
}
|
||||
@@ -37,7 +37,7 @@ impl LayoutHolder for LicensesThirdPartyDialog {
|
||||
.monospace(true)
|
||||
.multiline(true)
|
||||
.min_width(format!("{non_wrapping_column_width}ch"))
|
||||
.widget_holder(),
|
||||
.widget_instance(),
|
||||
],
|
||||
}]))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user