M7: pixel-exact icon set (#61)
Every UI icon redrawn on a strict 16 px grid: strokes on pixel centres, fills on pixel edges, and
consistent proportions. Painting snaps the glyph to the pixel grid, scales by whole steps above
16 px, hints straight strokes below it, and keeps strokes one physical pixel wide, so icons stay
sharp at every size and display scale. Concave fills (the move cursor) are triangulated instead of
drawn as convex polygons, which broke them. Icon buttons paint their glyph at its native 16 px.
Redrawn: hand, home, move cursor, comment, moon, undo/redo, rotate/reset, link, corner radius,
flip, eye, lock, clock and the rest of the set. `Icon::ALL` lists every icon; the control channel's
`ui.set {iconGallery: true}` shows them all at 12/16/24/32 px for review.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d7fd41cd13
commit
b26bbb2da8
|
|
@ -216,6 +216,9 @@ pub fn handle(app: &mut FigApp, ctx: &Context, method: &str, p: &Value) -> Resul
|
|||
if let Some(h) = p.get("mainMenu").and_then(Value::as_bool) {
|
||||
app.ui.main_menu = h;
|
||||
}
|
||||
if let Some(h) = p.get("iconGallery").and_then(Value::as_bool) {
|
||||
app.ui.icon_gallery = h;
|
||||
}
|
||||
// Comment thread popover: an id opens it, null closes it.
|
||||
if let Some(v) = p.get("commentOpen") {
|
||||
app.ui.comments.open = v.as_u64();
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -142,6 +142,8 @@ pub struct UiState {
|
|||
pub home: bool,
|
||||
/// How the window's title bar is drawn (the desktop app sets it when it opens the window).
|
||||
pub title_bar: TitleBar,
|
||||
/// Every icon on one screen, for reviewing the set (control channel `ui.set {iconGallery}`).
|
||||
pub icon_gallery: bool,
|
||||
pub toast: Option<(String, f64)>,
|
||||
pub present: Option<present::Presenter>,
|
||||
/// The prototype preview pane floating over the canvas, when open.
|
||||
|
|
@ -209,6 +211,7 @@ impl Default for UiState {
|
|||
shortcuts_panel: false,
|
||||
home: false,
|
||||
title_bar: TitleBar::Native,
|
||||
icon_gallery: false,
|
||||
toast: None,
|
||||
present: None,
|
||||
preview: None,
|
||||
|
|
@ -437,6 +440,9 @@ impl FigApp {
|
|||
if self.ui.title_bar == TitleBar::Custom {
|
||||
tabs::resize_edges(&ctx);
|
||||
}
|
||||
if self.ui.icon_gallery {
|
||||
icons::gallery(&ctx);
|
||||
}
|
||||
theme::set_doc_profile(&ctx, self.session.doc().map_or(figcraft_color::ColorProfile::Srgb, |d| d.color_profile));
|
||||
// The Inspect tab measures on hover without Alt.
|
||||
self.session.tool.redlines = self.ui.right_tab == RightTab::Inspect;
|
||||
|
|
|
|||
|
|
@ -94,10 +94,11 @@ text tool).
|
|||
|
||||
Invoke a menu item exactly like clicking it (this may open a dialog). Returns `{ok, lastError}`.
|
||||
|
||||
### `ui.set {rightTab?, leftTab?, theme?, home?, palette?, mainMenu?, colorPicker?, variables?, layerFilter?, collapseLayers?, exportPreview?, preview?, presentScroll?, colorProfileDialog?, stylePicker?, stylePickerEdit?, stylePickerView?}`
|
||||
### `ui.set {rightTab?, leftTab?, theme?, home?, palette?, mainMenu?, colorPicker?, variables?, layerFilter?, collapseLayers?, exportPreview?, preview?, presentScroll?, colorProfileDialog?, stylePicker?, stylePickerEdit?, stylePickerView?, iconGallery?}`
|
||||
|
||||
Switch panels and modes: `rightTab` `design|prototype|inspect`, `leftTab` `file|assets`, `theme`,
|
||||
`home` (bool), `palette` (bool: the Actions palette), `mainMenu` (bool), `colorPicker`
|
||||
`home` (bool), `palette` (bool: the Actions palette), `mainMenu` (bool), `iconGallery` (bool:
|
||||
every UI icon at 12, 16, 24 and 32 px over the window, for reviewing the icon set), `colorPicker`
|
||||
(`{fills?, index?}`: open the colour picker on the selection's paint; `null` closes it), `variables` (bool,
|
||||
or a collection id or name to show, or `{library, collection?}` for an enabled library's collection: the
|
||||
Variables editor), `layerFilter` (string:
|
||||
|
|
|
|||
Loading…
Reference in New Issue