feat(desktop): add official property and visibility menu icons

Extract FileIcon, HistoryIcon, and ViewIcon from @blocksuite/icons into packages/ui/tokens.

Show the matching Web icon on each built-in property row in the inspector and page information dialog.
Align built-in and custom row icons with the 160px name column, 6px gap, and 16px secondary icon style.

Use ViewIcon and InvisibleIcon in the visibility menu, and show DoneIcon next to the active option.
Add parity assertions for built-in row icons and visibility menu icons.
This commit is contained in:
DarkSky committed 2026-12-05 02:00:33 +09:00
1 parent 7605b96e7b
commit 9afd009dea
5 files changed
+467 -24

No files matched your search

@@ -12,7 +12,7 @@ use ui_tokens::icons::{self, IconDef};
use crate::DesktopFlexExt;
use super::{
Properties, PropertyFocusStop, button,
Properties, PropertyFocusStop,
property_input::{Commit, PropertyInput},
row_order::{Builtin, OrderedRow, RenderedRow},
};
@@ -24,12 +24,24 @@ const KINDS: [(&str, &str, IconDef); 4] = [
("date", "Date", icons::DATE_TIME),
];
const VISIBILITY: [(&str, &str); 3] = [
("always-show", "Always show"),
("hide-when-empty", "Hide when empty"),
("always-hide", "Always hide"),
const VISIBILITY: [(&str, &str, IconDef); 3] = [
("always-show", "Always show", icons::VIEW),
("hide-when-empty", "Hide when empty", icons::INVISIBLE),
("always-hide", "Always hide", icons::INVISIBLE),
];
pub(super) fn builtin_icon(id: &str) -> IconDef {
match id {
"tags" => icons::TAG,
"docPrimaryMode" => icons::FILE,
"journal" => icons::TODAY,
"createdAt" => icons::HISTORY,
"updatedAt" => icons::DATE_TIME,
"pageWidth" => icons::PAGE_WIDTH,
_ => icons::TEXT,
}
}
#[derive(Clone, PartialEq)]
enum Menu {
Add,
@@ -275,9 +287,16 @@ impl Panel<'_> {
.flex()
.items_center()
.gap(px(6.0))
.min_h(px(super::ROW_HEIGHT))
.p(px(super::CELL_PADDING))
.child(icon(row.icon, palette.text_muted))
.child(row.label.to_owned())
.child(icon(row.icon, super::icon_secondary(palette)))
.child(
div()
.flex_1()
.min_w_0()
.truncate()
.child(row.label.to_owned()),
)
};
let name = name.text_color(palette.text_muted);
let mut value = div().flex().items_start().min_w_0();
@@ -496,7 +515,7 @@ impl Panel<'_> {
for row in rows.iter().copied().filter(|row| row.hidden()) {
let (id, label, icon) = match row {
OrderedRow::Custom(row) => (row.info.id.as_str(), row.label, row.icon),
OrderedRow::Builtin(row) => (row.id, row.label, icons::INVISIBLE),
OrderedRow::Builtin(row) => (row.id, row.label, builtin_icon(row.id)),
};
let (button, stop) = self.control(&format!("show.{id}"), label, Some(icon));
let controls = self.controls.clone();
@@ -525,14 +544,20 @@ impl Panel<'_> {
.child(field)
.child(self.menu_label(&format!("Type {}", row.kind)))
.child(self.menu_label("Visibility"));
for (mode, label) in VISIBILITY {
for (mode, label, glyph) in VISIBILITY {
let selected = row.info.show.as_deref().unwrap_or("always-show") == mode;
let glyph = if selected {
icons::DONE
let color = if selected {
self.properties.palette.accent
} else {
icons::INVISIBLE
super::icon_secondary(self.properties.palette)
};
let (button, stop) =
self.control_with_icon(&format!("visibility.{mode}"), label, Some((glyph, color)));
let button = if selected {
button.child(div().flex_1()).child(icon(icons::DONE, color))
} else {
button
};
let (button, stop) = self.control(&format!("visibility.{mode}"), label, Some(glyph));
let controls = self.controls.clone();
let edit = self.edit(&row.info.id);
menu = menu.child(activate(button, stop, move |window, app| {
@@ -667,6 +692,16 @@ impl Panel<'_> {
id: &str,
label: &str,
glyph: Option<IconDef>,
) -> (Stateful<Div>, PropertyFocusStop) {
let color = super::icon_secondary(self.properties.palette);
self.control_with_icon(id, label, glyph.map(|glyph| (glyph, color)))
}
fn control_with_icon(
&mut self,
id: &str,
label: &str,
glyph: Option<(IconDef, ui::Hsla)>,
) -> (Stateful<Div>, PropertyFocusStop) {
let focus = self
.window
@@ -679,7 +714,19 @@ impl Panel<'_> {
let focused = focus.handle.is_focused(self.window);
let palette = self.properties.palette;
let snapshot = ui::snap_id!("{}.custom.{id}", self.properties.location.snapshot_prefix());
let mut control = button(self.properties.custom_key(id), "", palette, true)
let mut control = div()
.id(self.properties.custom_key(id))
.flex()
.flex_shrink(0.0)
.items_center()
.min_h(px(28.0))
.px(px(8.0))
.rounded(px(6.0))
.text_size(px(13.0))
.text_color(palette.text_primary)
.tab_stop(true)
.cursor_pointer()
.hover(move |style| style.bg(palette.hover_color))
.snapshot(snapshot, None)
.snapshot_focused(focused)
.track_focus(&focus.handle)
@@ -692,8 +739,8 @@ impl Panel<'_> {
})
.gap(px(6.0))
.child(focus.measure())
.children(glyph.map(|glyph| icon(glyph, palette.text_muted)))
.child(div().truncate().child(label.to_owned()));
.children(glyph.map(|(glyph, color)| icon(glyph, color)))
.children((!label.is_empty()).then(|| div().truncate().child(label.to_owned())));
control.style().justify_content = Some(ui::JustifyContent::FlexStart);
(control, focus)
}
@@ -457,7 +457,7 @@ impl RenderOnce for Properties {
_ => continue,
};
properties = properties.child(
property(builtin.label, value, palette)
property(custom_rows::builtin_icon(id), builtin.label, value, palette)
.snapshot(ui::snap_id!("{prefix}.builtin.{id}"), parent_snapshot),
);
if id == "tags" {
@@ -754,13 +754,32 @@ fn property_row(name: Div, value: Div) -> Div {
.child(value.flex_1())
}
fn property(label: &str, value: Div, palette: DesktopPalette) -> Div {
pub(super) fn icon_secondary(palette: DesktopPalette) -> ui::Hsla {
let mode = if palette.bg_canvas.l < 0.5 {
ui_tokens::ThemeMode::Dark
} else {
ui_tokens::ThemeMode::Light
};
let tokens = crate::theme_tokens_for(mode);
crate::theme_color(tokens, "--affine-v2-icon-secondary", tokens.text_secondary)
}
fn property(
glyph: ui_tokens::icons::IconDef,
label: &str,
value: Div,
palette: DesktopPalette,
) -> Div {
property_row(
div()
.flex()
.items_center()
.gap(px(6.0))
.min_h(px(ROW_HEIGHT))
.p(px(CELL_PADDING))
.whitespace_nowrap()
.text_color(palette.text_muted)
.child(label.to_owned()),
.child(custom_rows::icon(glyph, icon_secondary(palette)))
.child(div().flex_1().min_w_0().truncate().child(label.to_owned())),
value.p(px(CELL_PADDING)).text_color(palette.text_primary),
)
}
@@ -2,14 +2,16 @@
//! inspector rows that follow property, trash, and link edits.
use affine_desktop::{
DesktopAppState, DesktopRoute, DesktopShellView, DocInspectorTab, register_desktop_fonts,
DesktopAppState, DesktopRoute, DesktopShellView, DocInspectorTab, palette_for,
register_desktop_fonts,
};
use affine_store::workspace_db::WorkspaceDbTableName;
use anyhow::{Context as _, Result};
use ui::{
AppContext, Application, ApplicationHandle, Bounds, HeadlessPlatform, HeadlessWindow,
SnapshotRect, WindowBounds, WindowHandle, WindowOptions, point, px, size,
AppContext, Application, ApplicationHandle, Bounds, HeadlessPlatform, HeadlessWindow, Hsla,
Rgba, SnapshotRect, WindowBounds, WindowHandle, WindowOptions, point, px, size,
};
use ui_tokens::ThemeMode;
use ui_tokens::{DARK_THEME, LIGHT_THEME, ThemeMode};
const DOC: &str = "doc-sync";
/// Web `propertyNameContainer` width and `propertyRoot` gap.
@@ -75,6 +77,82 @@ impl Shell {
})
})
}
fn click(&self, id: &str) -> Result<()> {
let bounds = self
.bounds(id)?
.with_context(|| format!("missing element {id}"))?;
self.window.simulate_click(point(
px(bounds.x + bounds.width * 0.5),
px(bounds.y + bounds.height * 0.5),
));
self.window.request_frame();
Ok(())
}
fn icon_sprites(&self) -> Result<Vec<(SnapshotRect, Hsla)>> {
self.collect_icon_sprites(0)
}
fn menu_icon_sprites(&self, menu: SnapshotRect) -> Result<Vec<(SnapshotRect, Hsla)>> {
let min_order = self.app.update(|cx| {
self.handle.update(cx, |_, window, _| {
window
.rendered_scene()
.quads
.iter()
.filter(|quad| {
(quad.bounds.origin.x.0 - menu.x).abs() <= 1.0
&& (quad.bounds.origin.y.0 - menu.y).abs() <= 1.0
&& (quad.bounds.size.width.0 - menu.width).abs() <= 1.0
&& (quad.bounds.size.height.0 - menu.height).abs() <= 1.0
})
.map(|quad| quad.order)
.min()
.context("menu quad")
})
})??;
self.collect_icon_sprites(min_order)
}
fn collect_icon_sprites(&self, min_order: u32) -> Result<Vec<(SnapshotRect, Hsla)>> {
self.app.update(|cx| {
self.handle.update(cx, |_, window, _| {
window
.rendered_scene()
.monochrome_sprites
.iter()
.filter(|sprite| {
let w = sprite.bounds.size.width.0;
let h = sprite.bounds.size.height.0;
sprite.order >= min_order
&& (w - 16.0).abs() <= 0.1
&& (h - 16.0).abs() <= 0.1
})
.map(|sprite| {
(
SnapshotRect::new(
sprite.bounds.origin.x.0,
sprite.bounds.origin.y.0,
sprite.bounds.size.width.0,
sprite.bounds.size.height.0,
),
sprite.color,
)
})
.collect()
})
})
}
fn render_image(&self) -> Result<Vec<u8>> {
self.app.update(|cx| {
self.handle.update(cx, |_, window, _| {
let img = window.render_to_image()?;
Ok::<_, anyhow::Error>(img.into_raw())
})
})?
}
}
fn state(theme: ThemeMode) -> (DesktopAppState, [String; 2]) {
@@ -157,3 +235,275 @@ fn inspector_rows_follow_property_trash_and_link_edits() -> Result<()> {
);
Ok(())
}
fn expected_icon_secondary(theme: ThemeMode) -> Hsla {
let tokens = match theme {
ThemeMode::Light => &LIGHT_THEME,
ThemeMode::Dark => &DARK_THEME,
};
let color = tokens
.color("--affine-v2-icon-secondary")
.unwrap_or(tokens.text_secondary);
Rgba {
r: f32::from(color.r) / 255.0,
g: f32::from(color.g) / 255.0,
b: f32::from(color.b) / 255.0,
a: f32::from(color.a) / 255.0,
}
.into()
}
fn assert_hsla_close(actual: Hsla, expected: Hsla, label: &str) {
let a = Rgba::from(actual);
let e = Rgba::from(expected);
for (ch, (av, ev)) in [
("r", (a.r, e.r)),
("g", (a.g, e.g)),
("b", (a.b, e.b)),
("a", (a.a, e.a)),
] {
assert!(
(av - ev).abs() <= 0.01,
"{label} channel {ch}: got {av}, expected {ev}"
);
}
}
fn sprites_in(
sprites: &[(SnapshotRect, Hsla)],
container: SnapshotRect,
) -> Vec<(SnapshotRect, Hsla)> {
let mut found: Vec<_> = sprites
.iter()
.copied()
.filter(|(rect, _)| {
let cx = rect.x + rect.width * 0.5;
let cy = rect.y + rect.height * 0.5;
cx >= container.x
&& cx <= container.right()
&& cy >= container.y
&& cy <= container.bottom()
})
.collect();
found.sort_by(|(a, _), (b, _)| a.x.total_cmp(&b.x));
found
}
fn icon_patch(raw: &[u8], rect: SnapshotRect) -> Vec<[u8; 4]> {
let x0 = rect.x.round() as u32;
let y0 = rect.y.round() as u32;
let mut pixels = Vec::with_capacity(16 * 16);
for dy in 0..16 {
for dx in 0..16 {
let idx = (((y0 + dy) * 1280 + (x0 + dx)) * 4) as usize;
pixels.push([raw[idx], raw[idx + 1], raw[idx + 2], raw[idx + 3]]);
}
}
pixels
}
#[test]
fn builtin_rows_render_web_icons_aligned_with_custom_rows() -> Result<()> {
let builtins = [
"tags",
"docPrimaryMode",
"journal",
"createdAt",
"updatedAt",
"pageWidth",
];
for theme in [ThemeMode::Light, ThemeMode::Dark] {
let (mut state, ids) = state(theme);
for (id, kind, index) in [
("docPrimaryMode", "docPrimaryMode", "a0000002"),
("journal", "journal", "a0000003"),
] {
let row = serde_json::json!({
"id": id,
"type": kind,
"index": index,
"show": "always-show"
});
state
.store
.directory
.db_mut()
.upsert_db_row(WorkspaceDbTableName::DocCustomPropertyInfo, &row)
.expect("seed builtin definition");
}
let due_id = state
.store
.create_custom_property(DOC, "Due", "date")
.expect("date property");
assert!(
state
.store
.set_custom_property_value(DOC, &due_id, "2026-12-08")
);
let shell = Shell::new(state)?;
let sprites = shell.icon_sprites()?;
let image = shell.render_image()?;
let expected_color = expected_icon_secondary(theme);
let custom_name = shell
.bounds(&format!("desktop.inspector.custom.{}.name", ids[0]))?
.context("custom name")?;
let custom_icon = sprites_in(&sprites, custom_name)
.into_iter()
.next()
.context("custom row icon")?;
assert_hsla_close(custom_icon.1, expected_color, "custom row icon color");
let due_name = shell
.bounds(&format!("desktop.inspector.custom.{due_id}.name"))?
.context("due name")?;
let due_icon = sprites_in(&sprites, due_name)
.into_iter()
.next()
.context("due row icon")?;
let due_patch = icon_patch(&image, due_icon.0);
let mut patches = Vec::new();
for id in builtins {
let row = shell
.bounds(&format!("desktop.inspector.builtin.{id}"))?
.with_context(|| format!("missing builtin row {id}"))?;
let name_cell = SnapshotRect::new(row.x, row.y, NAME_WIDTH, 30.0);
let row_icons = sprites_in(&sprites, name_cell);
assert_eq!(row_icons.len(), 1, "{theme:?} {id}: expected 1 icon");
let (rect, color) = row_icons[0];
assert!(
(rect.x - custom_icon.0.x).abs() <= 0.1,
"{theme:?} {id}: icon x {} != custom {}",
rect.x,
custom_icon.0.x
);
let dy = rect.y - row.y;
let custom_dy = custom_icon.0.y - custom_name.y;
assert!(
(dy - custom_dy).abs() <= 0.5,
"{theme:?} {id}: icon dy {dy} != custom {custom_dy}"
);
assert_hsla_close(color, expected_color, &format!("{theme:?} {id}"));
let patch = icon_patch(&image, rect);
assert!(
patch.iter().any(|px| *px != patch[0]),
"{theme:?} {id}: icon patch is flat"
);
if id == "updatedAt" {
assert_eq!(
patch, due_patch,
"{theme:?}: updatedAt and date share DateTimeIcon"
);
}
patches.push((id, patch));
}
for i in 0..patches.len() {
for j in (i + 1)..patches.len() {
assert_ne!(
patches[i].1, patches[j].1,
"{theme:?}: {} and {} should render distinct icons",
patches[i].0, patches[j].0
);
}
}
}
Ok(())
}
#[test]
fn visibility_menu_renders_view_and_invisible_icons_and_selected_mark() -> Result<()> {
for theme in [ThemeMode::Light, ThemeMode::Dark] {
let (state, ids) = state(theme);
let shell = Shell::new(state)?;
let trigger = format!("desktop.inspector.custom.{}.name", ids[0]);
let accent = palette_for(theme).accent;
let muted_icon = expected_icon_secondary(theme);
shell.click(&trigger)?;
let menu = shell
.bounds("desktop.inspector.custom.menu.edit")?
.context("edit menu")?;
let sprites = shell.menu_icon_sprites(menu)?;
let always_show = shell
.bounds("desktop.inspector.custom.visibility.always-show")?
.context("always-show")?;
let hide_empty = shell
.bounds("desktop.inspector.custom.visibility.hide-when-empty")?
.context("hide-when-empty")?;
let always_hide = shell
.bounds("desktop.inspector.custom.visibility.always-hide")?
.context("always-hide")?;
let show_icons = sprites_in(&sprites, always_show);
let empty_icons = sprites_in(&sprites, hide_empty);
let hide_icons = sprites_in(&sprites, always_hide);
assert_eq!(
show_icons.len(),
2,
"{theme:?}: selected always-show has prefix + done"
);
assert_eq!(
empty_icons.len(),
1,
"{theme:?}: unselected hide-when-empty has 1 icon"
);
assert_eq!(
hide_icons.len(),
1,
"{theme:?}: unselected always-hide has 1 icon"
);
assert_hsla_close(show_icons[0].1, accent, "selected prefix");
assert_hsla_close(show_icons[1].1, accent, "selected done");
assert_hsla_close(empty_icons[0].1, muted_icon, "hide-when-empty prefix");
assert_hsla_close(hide_icons[0].1, muted_icon, "always-hide prefix");
shell.click("desktop.inspector.custom.visibility.hide-when-empty")?;
shell.click(&trigger)?;
let menu = shell
.bounds("desktop.inspector.custom.menu.edit")?
.context("edit menu")?;
let sprites = shell.menu_icon_sprites(menu)?;
let image = shell.render_image()?;
let always_show = shell
.bounds("desktop.inspector.custom.visibility.always-show")?
.context("always-show")?;
let hide_empty = shell
.bounds("desktop.inspector.custom.visibility.hide-when-empty")?
.context("hide-when-empty")?;
let always_hide = shell
.bounds("desktop.inspector.custom.visibility.always-hide")?
.context("always-hide")?;
let show_icons = sprites_in(&sprites, always_show);
let empty_icons = sprites_in(&sprites, hide_empty);
let hide_icons = sprites_in(&sprites, always_hide);
assert_eq!(
show_icons.len(),
1,
"{theme:?}: unselected always-show has 1 icon"
);
assert_eq!(
empty_icons.len(),
2,
"{theme:?}: selected hide-when-empty has prefix + done"
);
assert_eq!(
hide_icons.len(),
1,
"{theme:?}: unselected always-hide has 1 icon"
);
assert_hsla_close(show_icons[0].1, muted_icon, "unselected always-show prefix");
assert_hsla_close(empty_icons[0].1, accent, "selected hide-when-empty prefix");
assert_hsla_close(empty_icons[1].1, accent, "selected hide-when-empty done");
let view_patch = icon_patch(&image, show_icons[0].0);
let invisible_patch = icon_patch(&image, hide_icons[0].0);
assert_ne!(
view_patch, invisible_patch,
"{theme:?}: always-show (ViewIcon) must differ from always-hide (InvisibleIcon)"
);
}
Ok(())
}
+6
View File
@@ -131,6 +131,9 @@ const CORE_ICONS = [
// Document properties
['NUMBER', 'NumberIcon'],
['DATE_TIME', 'DateTimeIcon'],
['FILE', 'FileIcon'],
['HISTORY', 'HistoryIcon'],
['VIEW', 'ViewIcon'],
];
/**
@@ -1135,6 +1138,9 @@ mod tests {
assert_eq!(icon_by_name("PresentationIcon"), Some(&PRESENTATION));
assert_eq!(icon_by_name("NumberIcon"), Some(&NUMBER));
assert_eq!(icon_by_name("DateTimeIcon"), Some(&DATE_TIME));
assert_eq!(icon_by_name("FileIcon"), Some(&FILE));
assert_eq!(icon_by_name("HistoryIcon"), Some(&HISTORY));
assert_eq!(icon_by_name("ViewIcon"), Some(&VIEW));
}
#[test]
+21
View File
@@ -573,6 +573,21 @@ pub const DATE_TIME: IconDef = IconDef {
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M8.205 2.787c.393 0 .712.319.712.712v.711h6.166V3.5a.712.712 0 0 1 1.423 0v.711h2.135a2.61 2.61 0 0 1 2.609 2.61v11.384a2.61 2.61 0 0 1-2.609 2.609H5.359a2.61 2.61 0 0 1-2.609-2.61V6.82A2.61 2.61 0 0 1 5.359 4.21h2.135V3.5c0-.393.318-.712.711-.712m6.878 2.846v.712a.712.712 0 0 0 1.423 0v-.712h2.135c.655 0 1.186.531 1.186 1.186v1.66H4.173V6.82c0-.655.531-1.186 1.186-1.186h2.135v.712a.712.712 0 1 0 1.423 0v-.712zm-10.91 4.27h15.654v8.3c0 .656-.531 1.187-1.186 1.187H5.359c-.655 0-1.186-.531-1.186-1.186z\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const FILE: IconDef = IconDef {
name: "FileIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M8.17 2.25H13a.75.75 0 0 1 .53.22l6 6c.141.14.22.331.22.53v8.83c0 .535 0 .98-.03 1.345-.03.38-.098.736-.27 1.073a2.75 2.75 0 0 1-1.201 1.202c-.338.172-.694.24-1.074.27-.365.03-.81.03-1.344.03H8.17c-.535 0-.98 0-1.345-.03-.38-.03-.736-.098-1.073-.27A2.75 2.75 0 0 1 4.55 20.25c-.172-.338-.24-.694-.27-1.074-.03-.365-.03-.81-.03-1.345V6.17c0-.535 0-.98.03-1.345.03-.38.098-.736.27-1.073A2.75 2.75 0 0 1 5.752 2.55c.337-.172.693-.24 1.073-.27.365-.03.81-.03 1.345-.03M6.947 3.775c-.287.023-.424.065-.514.111a1.25 1.25 0 0 0-.547.547c-.046.09-.088.227-.111.514-.024.296-.025.68-.025 1.253v11.6c0 .572 0 .957.025 1.252.023.288.065.425.111.515.12.236.311.427.547.547.09.046.227.088.514.111.296.024.68.025 1.253.025h7.6c.572 0 .957 0 1.252-.025.288-.023.425-.065.515-.111a1.25 1.25 0 0 0 .547-.547c.046-.09.088-.227.111-.515.024-.295.025-.68.025-1.252V9.75H14A1.75 1.75 0 0 1 12.25 8V3.75H8.2c-.572 0-.957 0-1.253.025M13.75 4.81l3.44 3.439H14a.25.25 0 0 1-.25-.25z\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const HISTORY: IconDef = IconDef {
name: "HistoryIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M7.168 6.595h-.001l-1.217 1.1H7.5a.75.75 0 0 1 0 1.5H4a.75.75 0 0 1-.75-.75V5a.75.75 0 0 1 1.5 0v1.757l1.416-1.279a8.75 8.75 0 1 1-2.7 8.466.75.75 0 1 1 1.464-.332 7.25 7.25 0 1 0 2.238-7.017\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/><path d=\"M12 6.75a.75.75 0 0 1 .75.75v4.19l2.78 2.78a.75.75 0 1 1-1.06 1.06l-2.971-2.97a.85.85 0 0 1-.249-.601V7.5a.75.75 0 0 1 .75-.75\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const VIEW: IconDef = IconDef {
name: "ViewIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M12 5.75a9.25 9.25 0 0 0-8.635 5.926.9.9 0 0 0 0 .648 9.254 9.254 0 0 0 17.27 0 .9.9 0 0 0 0-.648A9.25 9.25 0 0 0 12 5.75M1.966 11.137C3.516 7.11 7.424 4.25 12 4.25s8.484 2.86 10.035 6.887c.214.555.214 1.17 0 1.726-1.55 4.027-5.458 6.887-10.034 6.887s-8.484-2.86-10.035-6.887a2.4 2.4 0 0 1 0-1.726M12 9.75a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5M8.25 12a3.75 3.75 0 1 1 7.5 0 3.75 3.75 0 0 1-7.5 0\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const ALL_ICONS: &[IconDef] = &[
ADD_TEXT,
ALL_DOCS,
@@ -618,6 +633,7 @@ pub const ALL_ICONS: &[IconDef] = &[
EXPAND,
FAVORITE,
FAVORITED,
FILE,
FOLDER,
FRAME,
GROUPING,
@@ -628,6 +644,7 @@ pub const ALL_ICONS: &[IconDef] = &[
HEADING_4,
HEADING_5,
HEADING_6,
HISTORY,
HOME,
IMAGE,
INFORMATION,
@@ -681,6 +698,7 @@ pub const ALL_ICONS: &[IconDef] = &[
UNDERLINE,
UNDO,
UNLOCK,
VIEW,
VIEW_LAYERS,
WARNING,
WRAP,
@@ -740,6 +758,9 @@ mod tests {
assert_eq!(icon_by_name("PresentationIcon"), Some(&PRESENTATION));
assert_eq!(icon_by_name("NumberIcon"), Some(&NUMBER));
assert_eq!(icon_by_name("DateTimeIcon"), Some(&DATE_TIME));
assert_eq!(icon_by_name("FileIcon"), Some(&FILE));
assert_eq!(icon_by_name("HistoryIcon"), Some(&HISTORY));
assert_eq!(icon_by_name("ViewIcon"), Some(&VIEW));
}
#[test]