settings_ui: Implement reset to default button (#40135)
Closes #ISSUE Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
@@ -279,7 +279,7 @@ impl Component for Icon {
|
||||
)
|
||||
}
|
||||
|
||||
fn preview(_window: &mut Window, _cx: &mut App) -> Option<AnyElement> {
|
||||
fn preview(_window: &mut Window, cx: &mut App) -> Option<AnyElement> {
|
||||
Some(
|
||||
v_flex()
|
||||
.gap_6()
|
||||
@@ -314,6 +314,30 @@ impl Component for Icon {
|
||||
),
|
||||
],
|
||||
),
|
||||
example_group_with_title(
|
||||
"All Icons",
|
||||
vec![single_example(
|
||||
"All Icons",
|
||||
h_flex()
|
||||
.image_cache(gpui::retain_all("all icons"))
|
||||
.flex_wrap()
|
||||
.gap_2()
|
||||
.children(<IconName as strum::IntoEnumIterator>::iter().map(
|
||||
|icon_name| {
|
||||
h_flex()
|
||||
.gap_1()
|
||||
.border_1()
|
||||
.rounded_md()
|
||||
.px_2()
|
||||
.py_1()
|
||||
.border_color(Color::Muted.color(cx))
|
||||
.child(SharedString::new_static(icon_name.into()))
|
||||
.child(Icon::new(icon_name).into_any_element())
|
||||
},
|
||||
))
|
||||
.into_any_element(),
|
||||
)],
|
||||
),
|
||||
])
|
||||
.into_any_element(),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user