From c63acc88677e92157ffcbe701a7925e0b88a3484 Mon Sep 17 00:00:00 2001 From: Ren Amamiya Date: Tue, 17 Nov 2026 18:17:24 +0700 Subject: [PATCH] wip --- crates/signed_app/src/app/mod.rs | 28 +- crates/signed_app/src/issues/mod.rs | 2 +- crates/signed_app/src/pull_requests/new.rs | 3 +- crates/signed_app/src/shared/widgets.rs | 2 +- crates/signed_app/src/titlebar/mod.rs | 88 +-- .../src/titlebar/repository_switcher.rs | 13 +- crates/signed_app/src/workspace.rs | 24 + crates/ui/src/components/combobox.rs | 5 +- crates/ui/src/components/input.rs | 4 +- crates/ui/src/components/markdown.rs | 2 +- crates/ui/src/components/menu.rs | 12 +- crates/ui/src/components/popover.rs | 6 +- crates/ui/src/components/tabs.rs | 3 +- crates/ui/src/components/tooltip.rs | 17 +- crates/ui/src/icons/NOTICE.md | 9 - crates/ui/src/icons/assets/a-large-small.svg | 3 - crates/ui/src/icons/assets/arrow-down.svg | 3 - crates/ui/src/icons/assets/arrow-left.svg | 3 - crates/ui/src/icons/assets/arrow-right.svg | 3 - crates/ui/src/icons/assets/arrow-up-down.svg | 16 - crates/ui/src/icons/assets/arrow-up.svg | 2 +- crates/ui/src/icons/assets/asterisk.svg | 1 - .../ui/src/icons/assets/battery-charging.svg | 1 - crates/ui/src/icons/assets/battery-full.svg | 1 - crates/ui/src/icons/assets/battery-low.svg | 1 - crates/ui/src/icons/assets/battery-medium.svg | 1 - .../ui/src/icons/assets/battery-warning.svg | 1 - crates/ui/src/icons/assets/battery.svg | 1 - crates/ui/src/icons/assets/bell.svg | 1 - crates/ui/src/icons/assets/book-open.svg | 1 - crates/ui/src/icons/assets/bot.svg | 1 - crates/ui/src/icons/assets/building-2.svg | 1 - crates/ui/src/icons/assets/calendar.svg | 1 - crates/ui/src/icons/assets/case-sensitive.svg | 3 - crates/ui/src/icons/assets/chart-pie.svg | 3 - crates/ui/src/icons/assets/check.svg | 4 +- crates/ui/src/icons/assets/chevron-down.svg | 2 +- crates/ui/src/icons/assets/chevron-left.svg | 1 - crates/ui/src/icons/assets/chevron-right.svg | 4 +- crates/ui/src/icons/assets/chevron-up.svg | 1 - .../ui/src/icons/assets/chevrons-up-down.svg | 3 - crates/ui/src/icons/assets/circle-check.svg | 1 - crates/ui/src/icons/assets/circle-plus.svg | 2 +- .../src/icons/assets/circle-question-mark.svg | 15 - crates/ui/src/icons/assets/circle-user.svg | 1 - crates/ui/src/icons/assets/circle-x.svg | 1 - .../ui/src/icons/assets/clipboard-paste.svg | 17 - crates/ui/src/icons/assets/clock.svg | 15 +- crates/ui/src/icons/assets/close.svg | 4 +- crates/ui/src/icons/assets/copy.svg | 2 +- crates/ui/src/icons/assets/cpu.svg | 1 - crates/ui/src/icons/assets/dash.svg | 1 - crates/ui/src/icons/assets/delete.svg | 3 - crates/ui/src/icons/assets/download.svg | 15 - .../ui/src/icons/assets/ellipsis-vertical.svg | 4 +- crates/ui/src/icons/assets/ellipsis.svg | 1 - crates/ui/src/icons/assets/external-link.svg | 1 - crates/ui/src/icons/assets/eye-off.svg | 4 +- crates/ui/src/icons/assets/eye.svg | 4 +- crates/ui/src/icons/assets/file.svg | 4 +- crates/ui/src/icons/assets/filter.svg | 1 - crates/ui/src/icons/assets/folder-closed.svg | 1 - crates/ui/src/icons/assets/folder-open.svg | 1 - crates/ui/src/icons/assets/folder.svg | 4 +- crates/ui/src/icons/assets/frame.svg | 1 - .../src/icons/assets/gallery-vertical-end.svg | 3 - crates/ui/src/icons/assets/git-branch.svg | 4 +- crates/ui/src/icons/assets/git-clone.svg | 4 +- crates/ui/src/icons/assets/git-commit.svg | 2 +- crates/ui/src/icons/assets/git-file.svg | 3 - .../ui/src/icons/assets/git-issue-close.svg | 1 - .../ui/src/icons/assets/git-issue-closed.svg | 3 + crates/ui/src/icons/assets/git-issue-done.svg | 2 +- .../ui/src/icons/assets/git-issue-ongoing.svg | 4 +- crates/ui/src/icons/assets/git-issue-open.svg | 1 - .../icons/assets/git-pull-request-closed.svg | 4 +- .../icons/assets/git-pull-request-draft.svg | 4 +- .../icons/assets/git-pull-request-merged.svg | 4 +- .../ui/src/icons/assets/git-pull-request.svg | 4 +- crates/ui/src/icons/assets/github.svg | 1 - crates/ui/src/icons/assets/global-on.svg | 1 - crates/ui/src/icons/assets/globe.svg | 1 - crates/ui/src/icons/assets/grid.svg | 2 +- crates/ui/src/icons/assets/hard-drive.svg | 1 - crates/ui/src/icons/assets/heart-off.svg | 1 - crates/ui/src/icons/assets/heart.svg | 1 - crates/ui/src/icons/assets/house.svg | 14 - crates/ui/src/icons/assets/image.svg | 15 - crates/ui/src/icons/assets/inbox.svg | 4 +- crates/ui/src/icons/assets/info.svg | 1 - crates/ui/src/icons/assets/init.svg | 3 - crates/ui/src/icons/assets/inspector.svg | 3 - .../ui/src/icons/assets/layout-dashboard.svg | 1 - crates/ui/src/icons/assets/layout-grid.svg | 16 - crates/ui/src/icons/assets/link.svg | 14 - crates/ui/src/icons/assets/list.svg | 18 - crates/ui/src/icons/assets/loader-circle.svg | 1 - crates/ui/src/icons/assets/loader.svg | 4 +- crates/ui/src/icons/assets/lock-open.svg | 14 - crates/ui/src/icons/assets/lock.svg | 14 - crates/ui/src/icons/assets/mail.svg | 14 - crates/ui/src/icons/assets/map.svg | 1 - crates/ui/src/icons/assets/markdown.svg | 2 +- crates/ui/src/icons/assets/maximize.svg | 1 - crates/ui/src/icons/assets/memory-stick.svg | 3 - crates/ui/src/icons/assets/menu.svg | 1 - crates/ui/src/icons/assets/mic.svg | 15 - crates/ui/src/icons/assets/microphone.svg | 3 + crates/ui/src/icons/assets/minimize.svg | 1 - crates/ui/src/icons/assets/minus.svg | 1 - crates/ui/src/icons/assets/moon.svg | 1 - crates/ui/src/icons/assets/more.svg | 3 + crates/ui/src/icons/assets/network.svg | 3 - crates/ui/src/icons/assets/palette.svg | 1 - .../ui/src/icons/assets/panel-bottom-open.svg | 3 - crates/ui/src/icons/assets/panel-bottom.svg | 3 - .../ui/src/icons/assets/panel-left-close.svg | 3 - .../ui/src/icons/assets/panel-left-open.svg | 3 - crates/ui/src/icons/assets/panel-left.svg | 3 - .../ui/src/icons/assets/panel-right-close.svg | 14 - .../ui/src/icons/assets/panel-right-open.svg | 1 - crates/ui/src/icons/assets/panel-right.svg | 1 - crates/ui/src/icons/assets/pause.svg | 1 - crates/ui/src/icons/assets/pencil.svg | 14 - crates/ui/src/icons/assets/pin.svg | 14 - crates/ui/src/icons/assets/play.svg | 1 - crates/ui/src/icons/assets/plus.svg | 2 +- crates/ui/src/icons/assets/printer.svg | 15 - crates/ui/src/icons/assets/recent.svg | 3 - crates/ui/src/icons/assets/redo-2.svg | 1 - crates/ui/src/icons/assets/redo.svg | 1 - crates/ui/src/icons/assets/refresh-cw.svg | 16 - crates/ui/src/icons/assets/refresh.svg | 2 +- crates/ui/src/icons/assets/replace.svg | 3 - crates/ui/src/icons/assets/resize-corner.svg | 1 - crates/ui/src/icons/assets/save.svg | 15 - crates/ui/src/icons/assets/scissors.svg | 17 - crates/ui/src/icons/assets/search.svg | 4 +- crates/ui/src/icons/assets/send.svg | 14 - crates/ui/src/icons/assets/settings-2.svg | 1 - crates/ui/src/icons/assets/settings.svg | 2 +- crates/ui/src/icons/assets/share.svg | 3 - crates/ui/src/icons/assets/sort-ascending.svg | 1 - .../ui/src/icons/assets/sort-descending.svg | 1 - .../ui/src/icons/assets/square-terminal.svg | 1 - crates/ui/src/icons/assets/square.svg | 13 - crates/ui/src/icons/assets/stack.svg | 3 + crates/ui/src/icons/assets/star-fill.svg | 3 - crates/ui/src/icons/assets/star-off.svg | 3 - crates/ui/src/icons/assets/star.svg | 1 - crates/ui/src/icons/assets/stop.svg | 3 + crates/ui/src/icons/assets/sun.svg | 1 - crates/ui/src/icons/assets/tag.svg | 1 - .../ui/src/icons/assets/text-align-center.svg | 15 - crates/ui/src/icons/assets/text-align-end.svg | 15 - .../ui/src/icons/assets/text-align-start.svg | 15 - crates/ui/src/icons/assets/thumbs-down.svg | 1 - crates/ui/src/icons/assets/thumbs-up.svg | 1 - crates/ui/src/icons/assets/trash.svg | 1 - crates/ui/src/icons/assets/trending.svg | 2 +- crates/ui/src/icons/assets/triangle-alert.svg | 1 - crates/ui/src/icons/assets/undo-2.svg | 1 - crates/ui/src/icons/assets/undo.svg | 1 - crates/ui/src/icons/assets/unlock.svg | 4 +- crates/ui/src/icons/assets/user.svg | 1 - crates/ui/src/icons/assets/volume-2.svg | 15 - crates/ui/src/icons/assets/volume-x.svg | 15 - crates/ui/src/icons/assets/warning.svg | 3 + crates/ui/src/icons/assets/window-close.svg | 1 - .../ui/src/icons/assets/window-maximize.svg | 2 +- .../ui/src/icons/assets/window-minimize.svg | 2 +- crates/ui/src/icons/assets/window-restore.svg | 2 +- crates/ui/src/icons/assets/x.svg | 14 - crates/ui/src/icons/assets/zoom-in.svg | 16 - crates/ui/src/icons/assets/zoom-out.svg | 15 - crates/ui/src/icons/freedesktop.rs | 276 -------- crates/ui/src/icons/mod.rs | 607 +----------------- crates/ui/src/icons/segoe.rs | 109 ---- crates/ui/src/layout/panel.rs | 4 +- crates/ui/src/layout/resize_handle.rs | 2 +- crates/ui/src/layout/titlebar.rs | 21 +- crates/ui/src/theme/mod.rs | 10 +- crates/ui/src/theme/resolve.rs | 6 +- desktop/src/main.rs | 5 +- 184 files changed, 240 insertions(+), 1743 deletions(-) delete mode 100644 crates/ui/src/icons/NOTICE.md delete mode 100644 crates/ui/src/icons/assets/a-large-small.svg delete mode 100644 crates/ui/src/icons/assets/arrow-down.svg delete mode 100644 crates/ui/src/icons/assets/arrow-left.svg delete mode 100644 crates/ui/src/icons/assets/arrow-right.svg delete mode 100644 crates/ui/src/icons/assets/arrow-up-down.svg delete mode 100644 crates/ui/src/icons/assets/asterisk.svg delete mode 100644 crates/ui/src/icons/assets/battery-charging.svg delete mode 100644 crates/ui/src/icons/assets/battery-full.svg delete mode 100644 crates/ui/src/icons/assets/battery-low.svg delete mode 100644 crates/ui/src/icons/assets/battery-medium.svg delete mode 100644 crates/ui/src/icons/assets/battery-warning.svg delete mode 100644 crates/ui/src/icons/assets/battery.svg delete mode 100644 crates/ui/src/icons/assets/bell.svg delete mode 100644 crates/ui/src/icons/assets/book-open.svg delete mode 100644 crates/ui/src/icons/assets/bot.svg delete mode 100644 crates/ui/src/icons/assets/building-2.svg delete mode 100644 crates/ui/src/icons/assets/calendar.svg delete mode 100644 crates/ui/src/icons/assets/case-sensitive.svg delete mode 100644 crates/ui/src/icons/assets/chart-pie.svg delete mode 100644 crates/ui/src/icons/assets/chevron-left.svg delete mode 100644 crates/ui/src/icons/assets/chevron-up.svg delete mode 100644 crates/ui/src/icons/assets/chevrons-up-down.svg delete mode 100644 crates/ui/src/icons/assets/circle-check.svg delete mode 100644 crates/ui/src/icons/assets/circle-question-mark.svg delete mode 100644 crates/ui/src/icons/assets/circle-user.svg delete mode 100644 crates/ui/src/icons/assets/circle-x.svg delete mode 100644 crates/ui/src/icons/assets/clipboard-paste.svg delete mode 100644 crates/ui/src/icons/assets/cpu.svg delete mode 100644 crates/ui/src/icons/assets/dash.svg delete mode 100644 crates/ui/src/icons/assets/delete.svg delete mode 100644 crates/ui/src/icons/assets/download.svg delete mode 100644 crates/ui/src/icons/assets/ellipsis.svg delete mode 100644 crates/ui/src/icons/assets/external-link.svg delete mode 100644 crates/ui/src/icons/assets/filter.svg delete mode 100644 crates/ui/src/icons/assets/folder-closed.svg delete mode 100644 crates/ui/src/icons/assets/folder-open.svg delete mode 100644 crates/ui/src/icons/assets/frame.svg delete mode 100644 crates/ui/src/icons/assets/gallery-vertical-end.svg delete mode 100644 crates/ui/src/icons/assets/git-file.svg delete mode 100644 crates/ui/src/icons/assets/git-issue-close.svg create mode 100644 crates/ui/src/icons/assets/git-issue-closed.svg delete mode 100644 crates/ui/src/icons/assets/git-issue-open.svg delete mode 100644 crates/ui/src/icons/assets/github.svg delete mode 100644 crates/ui/src/icons/assets/global-on.svg delete mode 100644 crates/ui/src/icons/assets/globe.svg delete mode 100644 crates/ui/src/icons/assets/hard-drive.svg delete mode 100644 crates/ui/src/icons/assets/heart-off.svg delete mode 100644 crates/ui/src/icons/assets/heart.svg delete mode 100644 crates/ui/src/icons/assets/house.svg delete mode 100644 crates/ui/src/icons/assets/image.svg delete mode 100644 crates/ui/src/icons/assets/info.svg delete mode 100644 crates/ui/src/icons/assets/init.svg delete mode 100644 crates/ui/src/icons/assets/inspector.svg delete mode 100644 crates/ui/src/icons/assets/layout-dashboard.svg delete mode 100644 crates/ui/src/icons/assets/layout-grid.svg delete mode 100644 crates/ui/src/icons/assets/link.svg delete mode 100644 crates/ui/src/icons/assets/list.svg delete mode 100644 crates/ui/src/icons/assets/loader-circle.svg delete mode 100644 crates/ui/src/icons/assets/lock-open.svg delete mode 100644 crates/ui/src/icons/assets/lock.svg delete mode 100644 crates/ui/src/icons/assets/mail.svg delete mode 100644 crates/ui/src/icons/assets/map.svg delete mode 100644 crates/ui/src/icons/assets/maximize.svg delete mode 100644 crates/ui/src/icons/assets/memory-stick.svg delete mode 100644 crates/ui/src/icons/assets/menu.svg delete mode 100644 crates/ui/src/icons/assets/mic.svg create mode 100644 crates/ui/src/icons/assets/microphone.svg delete mode 100644 crates/ui/src/icons/assets/minimize.svg delete mode 100644 crates/ui/src/icons/assets/minus.svg delete mode 100644 crates/ui/src/icons/assets/moon.svg create mode 100644 crates/ui/src/icons/assets/more.svg delete mode 100644 crates/ui/src/icons/assets/network.svg delete mode 100644 crates/ui/src/icons/assets/palette.svg delete mode 100644 crates/ui/src/icons/assets/panel-bottom-open.svg delete mode 100644 crates/ui/src/icons/assets/panel-bottom.svg delete mode 100644 crates/ui/src/icons/assets/panel-left-close.svg delete mode 100644 crates/ui/src/icons/assets/panel-left-open.svg delete mode 100644 crates/ui/src/icons/assets/panel-left.svg delete mode 100644 crates/ui/src/icons/assets/panel-right-close.svg delete mode 100644 crates/ui/src/icons/assets/panel-right-open.svg delete mode 100644 crates/ui/src/icons/assets/panel-right.svg delete mode 100644 crates/ui/src/icons/assets/pause.svg delete mode 100644 crates/ui/src/icons/assets/pencil.svg delete mode 100644 crates/ui/src/icons/assets/pin.svg delete mode 100644 crates/ui/src/icons/assets/play.svg delete mode 100644 crates/ui/src/icons/assets/printer.svg delete mode 100644 crates/ui/src/icons/assets/recent.svg delete mode 100644 crates/ui/src/icons/assets/redo-2.svg delete mode 100644 crates/ui/src/icons/assets/redo.svg delete mode 100644 crates/ui/src/icons/assets/refresh-cw.svg delete mode 100644 crates/ui/src/icons/assets/replace.svg delete mode 100644 crates/ui/src/icons/assets/resize-corner.svg delete mode 100644 crates/ui/src/icons/assets/save.svg delete mode 100644 crates/ui/src/icons/assets/scissors.svg delete mode 100644 crates/ui/src/icons/assets/send.svg delete mode 100644 crates/ui/src/icons/assets/settings-2.svg delete mode 100644 crates/ui/src/icons/assets/share.svg delete mode 100644 crates/ui/src/icons/assets/sort-ascending.svg delete mode 100644 crates/ui/src/icons/assets/sort-descending.svg delete mode 100644 crates/ui/src/icons/assets/square-terminal.svg delete mode 100644 crates/ui/src/icons/assets/square.svg create mode 100644 crates/ui/src/icons/assets/stack.svg delete mode 100644 crates/ui/src/icons/assets/star-fill.svg delete mode 100644 crates/ui/src/icons/assets/star-off.svg delete mode 100644 crates/ui/src/icons/assets/star.svg create mode 100644 crates/ui/src/icons/assets/stop.svg delete mode 100644 crates/ui/src/icons/assets/sun.svg delete mode 100644 crates/ui/src/icons/assets/tag.svg delete mode 100644 crates/ui/src/icons/assets/text-align-center.svg delete mode 100644 crates/ui/src/icons/assets/text-align-end.svg delete mode 100644 crates/ui/src/icons/assets/text-align-start.svg delete mode 100644 crates/ui/src/icons/assets/thumbs-down.svg delete mode 100644 crates/ui/src/icons/assets/thumbs-up.svg delete mode 100644 crates/ui/src/icons/assets/trash.svg delete mode 100644 crates/ui/src/icons/assets/triangle-alert.svg delete mode 100644 crates/ui/src/icons/assets/undo-2.svg delete mode 100644 crates/ui/src/icons/assets/undo.svg delete mode 100644 crates/ui/src/icons/assets/user.svg delete mode 100644 crates/ui/src/icons/assets/volume-2.svg delete mode 100644 crates/ui/src/icons/assets/volume-x.svg create mode 100644 crates/ui/src/icons/assets/warning.svg delete mode 100644 crates/ui/src/icons/assets/window-close.svg delete mode 100644 crates/ui/src/icons/assets/x.svg delete mode 100644 crates/ui/src/icons/assets/zoom-in.svg delete mode 100644 crates/ui/src/icons/assets/zoom-out.svg delete mode 100644 crates/ui/src/icons/freedesktop.rs delete mode 100644 crates/ui/src/icons/segoe.rs diff --git a/crates/signed_app/src/app/mod.rs b/crates/signed_app/src/app/mod.rs index b4a8f41..d93b43a 100644 --- a/crates/signed_app/src/app/mod.rs +++ b/crates/signed_app/src/app/mod.rs @@ -104,14 +104,16 @@ impl Render for AppRoot { let titlebar_view = self.titlebar.read(cx); let workspace = self.workspace.read(cx); let main = workspace.active_main(); - let has_main = main.is_some(); - let repo_tabs = - titlebar_view.render_repo_tabs(workspace.open_mains(), workspace.active_main_id()); - let tab_bar = h_flex() - .gap_2() - .child(titlebar_view.repository_switcher()) - .when_some(repo_tabs, |bar, tabs| bar.child(tabs)); + let prefix = h_flex() + .gap_1() + .child(titlebar_view.render_new_repository()) + .child(titlebar_view.repository_switcher()); + + let tab_bar = h_flex().gap_1().when_some( + titlebar_view.render_repo_tabs(workspace.open_mains(), workspace.active_main_id()), + |bar, tabs| bar.child(tabs), + ); div() .relative() @@ -133,7 +135,7 @@ impl Render for AppRoot { Shell::new("signed-shell") .titlebar( Titlebar::new("signed-titlebar") - .child(titlebar_view.render_actions()) + .prefix(prefix) .tab_bar(tab_bar) .when_some(titlebar_view.render_user_menu(cx), |titlebar, menu| { titlebar.suffix(menu) @@ -141,13 +143,15 @@ impl Render for AppRoot { ) .panel( PanelRow::new("signed-panel") - .when_some(main, |row, main| { - row.main(main).when(workspace.has_details(), |row| { + .when_some(main.as_ref(), |row, main| { + row.main(main.clone()).when(workspace.has_details(), |row| { row.split(self.workspace.clone()) }) }) - .when(!has_main && signed_in, |row| row.main(self.empty.clone())) - .when(!has_main && !signed_in, |row| { + .when(!main.is_some() && signed_in, |row| { + row.main(self.empty.clone()) + }) + .when(!main.is_some() && !signed_in, |row| { row.main(self.sign_in.clone()) }), ) diff --git a/crates/signed_app/src/issues/mod.rs b/crates/signed_app/src/issues/mod.rs index fe4c92f..a1d5565 100644 --- a/crates/signed_app/src/issues/mod.rs +++ b/crates/signed_app/src/issues/mod.rs @@ -137,7 +137,7 @@ impl IssuesView { SegmentedOption::new(IssueFilter::All, format!("All ({})", counts.total)) .icon(Icon::named(IconRole::GitIssueDone).color(muted)), SegmentedOption::new(IssueFilter::Open, format!("Open ({})", counts.open)) - .icon(Icon::named(IconRole::GitIssueOpen).color(muted)), + .icon(Icon::named(IconRole::GitIssueOngoing).color(muted)), SegmentedOption::new( IssueFilter::Closed, format!("Closed ({})", counts.closed), diff --git a/crates/signed_app/src/pull_requests/new.rs b/crates/signed_app/src/pull_requests/new.rs index 05c2149..7026b63 100644 --- a/crates/signed_app/src/pull_requests/new.rs +++ b/crates/signed_app/src/pull_requests/new.rs @@ -355,8 +355,7 @@ impl NewPullRequestView { .selected(self.active_tab) .tabs(move |_, _| { vec![ - Tab::new("files", format!("Files ({files})")) - .lead(Icon::named(IconRole::GitFile)), + Tab::new("files", format!("Files ({files})")).lead(Icon::named(IconRole::File)), Tab::new("commits", format!("Commits ({commits})")) .lead(Icon::named(IconRole::GitCommit)), ] diff --git a/crates/signed_app/src/shared/widgets.rs b/crates/signed_app/src/shared/widgets.rs index 23618d4..c6eb0b2 100644 --- a/crates/signed_app/src/shared/widgets.rs +++ b/crates/signed_app/src/shared/widgets.rs @@ -9,7 +9,7 @@ use ui::tooltip::Tooltip; /// The status pill shown on issue and pull-request rows. pub fn status_badge(status: RepoStatus) -> Badge { let (label, variant, icon) = match status { - RepoStatus::Open => ("Open", BadgeVariant::Neutral, IconRole::GitIssueOpen), + RepoStatus::Open => ("Open", BadgeVariant::Neutral, IconRole::GitIssueOngoing), RepoStatus::Closed => ("Closed", BadgeVariant::Danger, IconRole::GitIssueClosed), RepoStatus::Draft => ("Draft", BadgeVariant::Warning, IconRole::GitIssueOngoing), RepoStatus::Applied => ("Applied", BadgeVariant::Success, IconRole::GitIssueDone), diff --git a/crates/signed_app/src/titlebar/mod.rs b/crates/signed_app/src/titlebar/mod.rs index 533aa0f..a59d7b2 100644 --- a/crates/signed_app/src/titlebar/mod.rs +++ b/crates/signed_app/src/titlebar/mod.rs @@ -4,8 +4,7 @@ use std::sync::Arc; use gpui::{ AnyElement, App, AppContext as _, Context, Entity, IntoElement, KeyBinding, - KeyBindingContextPredicate, ParentElement as _, SharedString, Styled as _, Subscription, - WeakEntity, Window, px, + KeyBindingContextPredicate, ParentElement as _, SharedString, Subscription, WeakEntity, Window, }; use metadata::{Profile, ProfileDirectory}; use nostr::prelude::PublicKey; @@ -16,11 +15,9 @@ use signed_state::{Backend, BackendEvent, LocalReposStore, RepoListStore, Resolv use ui::avatar::Avatar; use ui::button::{Button, ButtonVariant}; use ui::command_palette::{Command, CommandPalette, CommandPaletteState}; -use ui::common::h_flex; use ui::icons::{Icon, IconRole}; use ui::menu::{Menu, MenuItem}; use ui::tabs::{Tab, Tabs, TabsVariant}; -use ui::theme::ActiveTheme as _; use ui::tooltip::Tooltip; use crate::repo::{RepoDetailView, actions, dialogs}; @@ -364,6 +361,7 @@ impl TitlebarView { .unwrap_or(usize::MAX); let workspace = self.workspace.clone(); + let close_workspace = self.workspace.clone(); let open_for_change = open.to_vec(); Some( @@ -380,7 +378,7 @@ impl TitlebarView { .map(|entry| entry.label.clone()) .unwrap_or_else(|| id.clone()); - let mut tab = Tab::new(id.clone(), label); + let mut tab = Tab::new(id.clone(), label).closeable(true); if let Some(entry) = entry { tab = tab.lead(entry.avatar(&lookup_directory, cx)); } @@ -395,6 +393,11 @@ impl TitlebarView { log_dropped(workspace.update(cx, |workspace, cx| { workspace.activate_main(&id, cx); })); + }) + .on_close(move |index, _, cx| { + log_dropped(close_workspace.update(cx, |workspace, cx| { + workspace.close_main_at(index, cx); + })); }), ) } @@ -502,40 +505,48 @@ impl TitlebarView { Some(self.render_user(&profile, cx).into_any_element()) } - fn render_user(&self, profile: &Profile, cx: &App) -> impl IntoElement { + pub fn render_new_repository(&self) -> AnyElement { + let workspace = self.workspace.clone(); + + Button::new("add-repo") + .icon(IconRole::Plus) + .variant(ButtonVariant::Ghost) + .fully_rounded(true) + .tooltip(Tooltip::text("Create repository")) + .on_click(move |_, window, cx| { + dialogs::create::open(workspace.clone(), window, cx); + }) + .into_any_element() + } + + fn render_user(&self, profile: &Profile, _cx: &App) -> impl IntoElement { let name = profile.name(); let picture = profile.picture(); let public_key = profile.public_key(); let weak = self.weak.clone(); - let muted = cx.theme().colors.muted_foreground; Menu::new("user-menu") .open(self.user_menu_open) - .on_change({ - let weak = weak.clone(); - move |open, _, cx| { - log_dropped(weak.update(cx, |this, cx| { - this.user_menu_open = open; - cx.notify(); - })); - } + .on_change(move |open, _, cx| { + log_dropped(weak.update(cx, |this, cx| { + this.user_menu_open = open; + cx.notify(); + })); }) .trigger({ let name = name.clone(); let picture = picture.clone(); move |_, _| { - h_flex() - .gap_1() - .items_center() + Button::new("user-menu-trigger") + .variant(ButtonVariant::Ghost) + .fully_rounded(true) + .padded(false) + .accessibility_label(name.clone()) .child( Avatar::new(public_key) .name(name.clone()) - .picture(picture.clone()), - ) - .child( - Icon::named(IconRole::ChevronDown) - .size(px(12.)) - .color(muted), + .picture(picture.clone()) + .fully_rounded(true), ) .into_any_element() } @@ -550,35 +561,6 @@ impl TitlebarView { ] }) } - - pub fn render_actions(&self) -> AnyElement { - let workspace = self.workspace.clone(); - - h_flex() - .gap_1() - .child( - Button::new("open-command-palette") - .icon(IconRole::Search) - .variant(ButtonVariant::Ghost) - .tooltip(Tooltip::text("Command palette")) - .on_click({ - let palette = self.palette.clone(); - move |_, window, cx| { - palette.update(cx, |palette, cx| palette.toggle(window, cx)); - } - }), - ) - .child( - Button::new("add-repo") - .icon(IconRole::Plus) - .variant(ButtonVariant::Ghost) - .tooltip(Tooltip::text("Create repository")) - .on_click(move |_, window, cx| { - dialogs::create::open(workspace.clone(), window, cx); - }), - ) - .into_any_element() - } } fn announcement_key(announcement: &Announcement) -> SharedString { diff --git a/crates/signed_app/src/titlebar/repository_switcher.rs b/crates/signed_app/src/titlebar/repository_switcher.rs index 0cecccf..edf0ce9 100644 --- a/crates/signed_app/src/titlebar/repository_switcher.rs +++ b/crates/signed_app/src/titlebar/repository_switcher.rs @@ -128,8 +128,9 @@ impl Render for RepositorySwitcher { }) .trigger(move |_window: &mut Window, _cx: &mut App| { Button::new("repo-switcher") - .icon(Icon::named(IconRole::Folder)) + .icon(Icon::named(IconRole::Stack)) .variant(ButtonVariant::Ghost) + .fully_rounded(true) .tooltip(Tooltip::text("Repositories")) .accessibility_label("Repositories") .into_any_element() @@ -150,7 +151,7 @@ impl Render for RepositorySwitcher { .cloned() .collect(); - let row_height = theme.sizes.medium.menu_item_height + theme.spacing.unit * 0.5; + let row_height = theme.sizes.medium.menu_item_height + px(2.); let list_height = (row_height * visible.len() as f32).min(px(280.)); let list_entries = visible.clone(); let list_directory = directory.clone(); @@ -160,8 +161,8 @@ impl Render for RepositorySwitcher { v_flex() .w(px(380.)) - .p(theme.spacing.unit * 2.0) - .gap(theme.spacing.unit * 2.0) + .p_2() + .gap_2() .child( Input::new("repo-switcher-search", content_search.clone()) .placeholder("Filter repositories...") @@ -204,8 +205,8 @@ impl Render for RepositorySwitcher { .role(Role::MenuItem) .w_full() .h(row_height) - .px(theme.spacing.unit * 3.0) - .gap(theme.spacing.unit * 2.0) + .px_3() + .gap_2() .rounded(theme.radius.control) .text_size(theme.sizes.medium.text_size) .hover(|row| row.bg(theme.colors.muted)) diff --git a/crates/signed_app/src/workspace.rs b/crates/signed_app/src/workspace.rs index 46dbce8..b110866 100644 --- a/crates/signed_app/src/workspace.rs +++ b/crates/signed_app/src/workspace.rs @@ -115,6 +115,30 @@ impl Workspace { self.close_detail_at(index, cx); } + pub fn close_main_at(&mut self, index: usize, cx: &mut Context) { + if index >= self.main_order.len() { + return; + } + + let id = self.main_order.remove(index); + self.main_views.remove(&id); + + if self.main.as_ref() == Some(&id) { + self.main = self + .main_order + .get(index) + .or_else(|| { + index + .checked_sub(1) + .and_then(|prev| self.main_order.get(prev)) + }) + .cloned(); + self.clear_details(); + } + + cx.notify(); + } + pub fn clear(&mut self, cx: &mut Context) { self.main = None; self.main_order.clear(); diff --git a/crates/ui/src/components/combobox.rs b/crates/ui/src/components/combobox.rs index 563d8a0..d0c97bd 100644 --- a/crates/ui/src/components/combobox.rs +++ b/crates/ui/src/components/combobox.rs @@ -511,7 +511,7 @@ where T: Clone + PartialEq + 'static, { fn render(&mut self, window: &mut Window, cx: &mut Context) -> impl IntoElement { - let (metrics, colors, radius, panel_border, spacing_unit, shadows) = { + let (metrics, colors, radius, panel_border, shadows) = { let theme = cx.theme(); let metrics = theme.sizes.resolve(self.size); @@ -520,7 +520,6 @@ where theme.colors, theme.radius, theme.colors.border, - theme.spacing.unit, theme.elevations.popover.shadows(), ) }; @@ -780,7 +779,7 @@ where ); wrapper.child( - deferred(anchored().offset(point(px(0.), spacing_unit)).child(panel)) + deferred(anchored().offset(point(px(0.), px(4.))).child(panel)) .with_priority(OVERLAY_LAYER), ) }) diff --git a/crates/ui/src/components/input.rs b/crates/ui/src/components/input.rs index 4594a66..8c020a0 100644 --- a/crates/ui/src/components/input.rs +++ b/crates/ui/src/components/input.rs @@ -2176,12 +2176,12 @@ impl RenderOnce for Input { .w_full() .h(field_height) .pl(if self.prefix.is_some() { - edge_inset + metrics.padding_x } else { metrics.dense_padding_x }) .pr(if self.suffix.is_some() { - edge_inset + metrics.padding_x } else { metrics.dense_padding_x }) diff --git a/crates/ui/src/components/markdown.rs b/crates/ui/src/components/markdown.rs index 154ccf4..70c7838 100644 --- a/crates/ui/src/components/markdown.rs +++ b/crates/ui/src/components/markdown.rs @@ -1585,7 +1585,7 @@ fn text_row( .pr_1() .child(match marker { ListMarker::Bullet => div() - .size(theme.spacing.unit) + .size_1() .rounded(theme.radius.full) .bg(theme.colors.muted_foreground) .into_any_element(), diff --git a/crates/ui/src/components/menu.rs b/crates/ui/src/components/menu.rs index c18ca26..7598915 100644 --- a/crates/ui/src/components/menu.rs +++ b/crates/ui/src/components/menu.rs @@ -204,7 +204,6 @@ pub(crate) struct MenuChrome { icon_size: Pixels, dense_icon_size: Pixels, menu_item_height: Pixels, - spacing_unit: Pixels, text_size: Pixels, shadow: Vec, } @@ -246,7 +245,6 @@ impl MenuChrome { icon_size: theme.sizes.medium.icon_size, dense_icon_size: theme.sizes.medium.dense_icon_size, menu_item_height: theme.sizes.medium.menu_item_height, - spacing_unit: theme.spacing.unit, text_size: theme.sizes.medium.text_size, shadow: theme.elevations.popover.shadows(), }, @@ -579,7 +577,7 @@ pub(crate) fn anchored_menu_panel( Some(position) => anchored().position(position), None => anchored(), } - .offset(point(px(0.), chrome.spacing_unit)); + .offset(point(px(0.), px(4.))); Some( deferred(anchored.child(panel)) @@ -709,7 +707,7 @@ fn menu_panel( .when(params.min_width.is_none(), |panel| { panel.min_w(MENU_MIN_WIDTH) }) - .p(params.chrome.spacing_unit) + .p_1() .bg(params.chrome.surface) .text_color(params.chrome.foreground) .rounded(params.chrome.radius_overlay) @@ -817,8 +815,8 @@ fn render_item( MenuItemKind::Separator => div() .h(BORDER_WIDTH) .debug_selector(move || format!("{}-separator-{index}", env.debug_prefix)) - .mx(env.chrome.spacing_unit * 2.0) - .my(env.chrome.spacing_unit) + .mx_2() + .my_1() .bg(env.chrome.border) .into_any_element(), MenuItemKind::Action => { @@ -975,7 +973,7 @@ fn row_shell( .items_center() .gap_2() .min_h(chrome.menu_item_height) - .px(chrome.spacing_unit * 4.0) + .px_4() .text_size(chrome.text_size) .line_height(relative(1.0)) .rounded(chrome.radius_sm) diff --git a/crates/ui/src/components/popover.rs b/crates/ui/src/components/popover.rs index 113c151..e17d866 100644 --- a/crates/ui/src/components/popover.rs +++ b/crates/ui/src/components/popover.rs @@ -28,6 +28,7 @@ use gpui::{ InteractiveElement as _, IntoElement, KeyDownEvent, MouseButton, MouseDownEvent, ParentElement as _, Pixels, RenderOnce, Role, SharedString, StatefulInteractiveElement as _, StyleRefinement, Styled as _, Window, anchored, canvas, deferred, div, ease_out_quint, point, + px, }; use crate::components::common::{OVERLAY_LAYER, StyledExt as _, v_flex}; @@ -123,7 +124,7 @@ impl gpui::Styled for Popover { impl RenderOnce for Popover { fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement { - let (colors, radius, shadows, enter_duration, panel_border, anchor_gap) = { + let (colors, radius, shadows, enter_duration, panel_border) = { let theme = cx.theme(); ( theme.colors, @@ -131,7 +132,6 @@ impl RenderOnce for Popover { theme.elevations.popover.shadows(), theme.motion.overlay, theme.colors.border, - theme.spacing.unit, ) }; @@ -253,7 +253,7 @@ impl RenderOnce for Popover { ); wrapper.child( - deferred(anchored().offset(point(Pixels::ZERO, anchor_gap)).child( + deferred(anchored().offset(point(Pixels::ZERO, px(4.))).child( panel.with_animation( "popover-enter", Animation::new(enter_duration).with_easing(ease_out_quint()), diff --git a/crates/ui/src/components/tabs.rs b/crates/ui/src/components/tabs.rs index 06530e5..f01e235 100644 --- a/crates/ui/src/components/tabs.rs +++ b/crates/ui/src/components/tabs.rs @@ -25,7 +25,7 @@ use gpui::{ InteractiveElement as _, IntoElement, KeyDownEvent, MouseButton, ParentElement as _, Pixels, Point, Render, RenderOnce, Role, SharedString, Stateful, StatefulInteractiveElement as _, StyleRefinement, Styled as _, TextOverflow, Window, canvas, div, linear_color_stop, - linear_gradient, px, relative, + linear_gradient, px, }; use crate::components::button::{Button, ButtonVariant}; @@ -1151,7 +1151,6 @@ impl Tab { .role(Role::Tab) .aria_selected(selected) .text_color(label_color) - .line_height(relative(1.0)) .when(titlebar, |strip_tab| strip_tab.group(group.clone())) .when(!self.disabled && !active, |strip_tab| { strip_tab.hover(|strip_tab| { diff --git a/crates/ui/src/components/tooltip.rs b/crates/ui/src/components/tooltip.rs index fb0e08e..96cc2f3 100644 --- a/crates/ui/src/components/tooltip.rs +++ b/crates/ui/src/components/tooltip.rs @@ -16,7 +16,7 @@ use gpui::{ AnyView, App, AppContext as _, Bounds, Context, ElementId, Entity, InteractiveElement as _, IntoElement, ParentElement as _, Pixels, Render, Role, SharedString, - StatefulInteractiveElement as _, Styled as _, Window, canvas, div, point, + StatefulInteractiveElement as _, Styled as _, Window, canvas, div, point, px, }; use crate::components::common::{anchor_bounds, record_anchor_bounds}; @@ -82,7 +82,6 @@ impl Render for Tooltip { let theme = cx.theme(); let text_size = theme.sizes.medium.text_size; let line_height = theme.typography.callout.line_height; - let spacing_unit = theme.spacing.unit; let surface = theme.colors.surface; let surface_foreground = theme.colors.surface_foreground; let radius_sm = theme.radius.sm; @@ -120,18 +119,18 @@ impl Render for Tooltip { cx, ) .map(|bounds| bounds.size.height) - .unwrap_or_else(|| line_height + spacing_unit * 2.0 + BORDER_WIDTH * 2.0); + .unwrap_or_else(|| line_height + px(8.) + BORDER_WIDTH * 2.0); - let below = viewport_height - spacing_unit - parent.bottom(); - let above = parent.top() - spacing_unit; + let below = viewport_height - px(4.) - parent.bottom(); + let above = parent.top() - px(4.); let hang_below = below >= height || below >= above; let panel = build_panel() .ml(parent.left() - origin.x) .mt(if hang_below { - parent.bottom() + spacing_unit - origin.y + parent.bottom() + px(4.) - origin.y } else { - parent.top() - spacing_unit - height - origin.y + parent.top() - px(4.) - height - origin.y }) .child( canvas( @@ -146,8 +145,8 @@ impl Render for Tooltip { None => { let wrapper = div() .debug_selector(|| "tooltip-anchor".to_string()) - .pl(spacing_unit * 2.0) - .pt(spacing_unit * 2.0); + .pl_2() + .pt_2(); (wrapper, build_panel()) } }; diff --git a/crates/ui/src/icons/NOTICE.md b/crates/ui/src/icons/NOTICE.md deleted file mode 100644 index f8466f1..0000000 --- a/crates/ui/src/icons/NOTICE.md +++ /dev/null @@ -1,9 +0,0 @@ -# Licenses - -## Bundled icons (`assets/*.svg`) - -Lucide, ISC License, © Lucide Contributors. Fetched from https://github.com/lucide-icons/lucide (main) on 2026-10-28 and 2026-11-13. These are the offline fallback glyphs, see https://lucide.dev/license. - -## Platform glyph sets (not bundled) - -SF Symbols (macOS) and Segoe Fluent Icons (Windows) are resolved through the operating system at runtime and are never extracted, modified, or redistributed. Freedesktop icons are loaded from the user's installed icon themes. diff --git a/crates/ui/src/icons/assets/a-large-small.svg b/crates/ui/src/icons/assets/a-large-small.svg deleted file mode 100644 index 8a2054b..0000000 --- a/crates/ui/src/icons/assets/a-large-small.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/arrow-down.svg b/crates/ui/src/icons/assets/arrow-down.svg deleted file mode 100644 index 3458ca1..0000000 --- a/crates/ui/src/icons/assets/arrow-down.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/arrow-left.svg b/crates/ui/src/icons/assets/arrow-left.svg deleted file mode 100644 index 4306eda..0000000 --- a/crates/ui/src/icons/assets/arrow-left.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/arrow-right.svg b/crates/ui/src/icons/assets/arrow-right.svg deleted file mode 100644 index 8aa7e0d..0000000 --- a/crates/ui/src/icons/assets/arrow-right.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/arrow-up-down.svg b/crates/ui/src/icons/assets/arrow-up-down.svg deleted file mode 100644 index c8d7f2f..0000000 --- a/crates/ui/src/icons/assets/arrow-up-down.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - diff --git a/crates/ui/src/icons/assets/arrow-up.svg b/crates/ui/src/icons/assets/arrow-up.svg index 9f49eb5..cfc3036 100644 --- a/crates/ui/src/icons/assets/arrow-up.svg +++ b/crates/ui/src/icons/assets/arrow-up.svg @@ -1,3 +1,3 @@ - + diff --git a/crates/ui/src/icons/assets/asterisk.svg b/crates/ui/src/icons/assets/asterisk.svg deleted file mode 100644 index db9b6d9..0000000 --- a/crates/ui/src/icons/assets/asterisk.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/battery-charging.svg b/crates/ui/src/icons/assets/battery-charging.svg deleted file mode 100644 index 6d1fb4e..0000000 --- a/crates/ui/src/icons/assets/battery-charging.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/battery-full.svg b/crates/ui/src/icons/assets/battery-full.svg deleted file mode 100644 index b21cf4e..0000000 --- a/crates/ui/src/icons/assets/battery-full.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/battery-low.svg b/crates/ui/src/icons/assets/battery-low.svg deleted file mode 100644 index 6d41f28..0000000 --- a/crates/ui/src/icons/assets/battery-low.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/battery-medium.svg b/crates/ui/src/icons/assets/battery-medium.svg deleted file mode 100644 index 18daeeb..0000000 --- a/crates/ui/src/icons/assets/battery-medium.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/battery-warning.svg b/crates/ui/src/icons/assets/battery-warning.svg deleted file mode 100644 index 4dc94a5..0000000 --- a/crates/ui/src/icons/assets/battery-warning.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/battery.svg b/crates/ui/src/icons/assets/battery.svg deleted file mode 100644 index bb105c5..0000000 --- a/crates/ui/src/icons/assets/battery.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/bell.svg b/crates/ui/src/icons/assets/bell.svg deleted file mode 100644 index 455e1ff..0000000 --- a/crates/ui/src/icons/assets/bell.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/book-open.svg b/crates/ui/src/icons/assets/book-open.svg deleted file mode 100644 index f3fc42b..0000000 --- a/crates/ui/src/icons/assets/book-open.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/bot.svg b/crates/ui/src/icons/assets/bot.svg deleted file mode 100644 index cabeb2a..0000000 --- a/crates/ui/src/icons/assets/bot.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/building-2.svg b/crates/ui/src/icons/assets/building-2.svg deleted file mode 100644 index 496eff3..0000000 --- a/crates/ui/src/icons/assets/building-2.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/calendar.svg b/crates/ui/src/icons/assets/calendar.svg deleted file mode 100644 index 9d6afdd..0000000 --- a/crates/ui/src/icons/assets/calendar.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/case-sensitive.svg b/crates/ui/src/icons/assets/case-sensitive.svg deleted file mode 100644 index 8a2054b..0000000 --- a/crates/ui/src/icons/assets/case-sensitive.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/chart-pie.svg b/crates/ui/src/icons/assets/chart-pie.svg deleted file mode 100644 index 3832648..0000000 --- a/crates/ui/src/icons/assets/chart-pie.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/check.svg b/crates/ui/src/icons/assets/check.svg index 899c1cb..b962a50 100644 --- a/crates/ui/src/icons/assets/check.svg +++ b/crates/ui/src/icons/assets/check.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/crates/ui/src/icons/assets/chevron-down.svg b/crates/ui/src/icons/assets/chevron-down.svg index 36be93e..a5717ec 100644 --- a/crates/ui/src/icons/assets/chevron-down.svg +++ b/crates/ui/src/icons/assets/chevron-down.svg @@ -1,3 +1,3 @@ - + diff --git a/crates/ui/src/icons/assets/chevron-left.svg b/crates/ui/src/icons/assets/chevron-left.svg deleted file mode 100644 index 7e51ed1..0000000 --- a/crates/ui/src/icons/assets/chevron-left.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/chevron-right.svg b/crates/ui/src/icons/assets/chevron-right.svg index 0b8688f..68f0b1b 100644 --- a/crates/ui/src/icons/assets/chevron-right.svg +++ b/crates/ui/src/icons/assets/chevron-right.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/crates/ui/src/icons/assets/chevron-up.svg b/crates/ui/src/icons/assets/chevron-up.svg deleted file mode 100644 index f9b878e..0000000 --- a/crates/ui/src/icons/assets/chevron-up.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/chevrons-up-down.svg b/crates/ui/src/icons/assets/chevrons-up-down.svg deleted file mode 100644 index 1fe0fa9..0000000 --- a/crates/ui/src/icons/assets/chevrons-up-down.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/circle-check.svg b/crates/ui/src/icons/assets/circle-check.svg deleted file mode 100644 index d1e1f8b..0000000 --- a/crates/ui/src/icons/assets/circle-check.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/circle-plus.svg b/crates/ui/src/icons/assets/circle-plus.svg index 96ac654..a615ad7 100644 --- a/crates/ui/src/icons/assets/circle-plus.svg +++ b/crates/ui/src/icons/assets/circle-plus.svg @@ -1,3 +1,3 @@ - + diff --git a/crates/ui/src/icons/assets/circle-question-mark.svg b/crates/ui/src/icons/assets/circle-question-mark.svg deleted file mode 100644 index 1d9c175..0000000 --- a/crates/ui/src/icons/assets/circle-question-mark.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/crates/ui/src/icons/assets/circle-user.svg b/crates/ui/src/icons/assets/circle-user.svg deleted file mode 100644 index 9f41a7d..0000000 --- a/crates/ui/src/icons/assets/circle-user.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/circle-x.svg b/crates/ui/src/icons/assets/circle-x.svg deleted file mode 100644 index c9904ae..0000000 --- a/crates/ui/src/icons/assets/circle-x.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/clipboard-paste.svg b/crates/ui/src/icons/assets/clipboard-paste.svg deleted file mode 100644 index 6ac5933..0000000 --- a/crates/ui/src/icons/assets/clipboard-paste.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - diff --git a/crates/ui/src/icons/assets/clock.svg b/crates/ui/src/icons/assets/clock.svg index b6ae283..92006ab 100644 --- a/crates/ui/src/icons/assets/clock.svg +++ b/crates/ui/src/icons/assets/clock.svg @@ -1,14 +1,3 @@ - - - + + diff --git a/crates/ui/src/icons/assets/close.svg b/crates/ui/src/icons/assets/close.svg index 03a63bc..debd9cb 100644 --- a/crates/ui/src/icons/assets/close.svg +++ b/crates/ui/src/icons/assets/close.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/crates/ui/src/icons/assets/copy.svg b/crates/ui/src/icons/assets/copy.svg index d03829b..9baa702 100644 --- a/crates/ui/src/icons/assets/copy.svg +++ b/crates/ui/src/icons/assets/copy.svg @@ -1,3 +1,3 @@ - + diff --git a/crates/ui/src/icons/assets/cpu.svg b/crates/ui/src/icons/assets/cpu.svg deleted file mode 100644 index 90cff8b..0000000 --- a/crates/ui/src/icons/assets/cpu.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/dash.svg b/crates/ui/src/icons/assets/dash.svg deleted file mode 100644 index 1bd2a89..0000000 --- a/crates/ui/src/icons/assets/dash.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/delete.svg b/crates/ui/src/icons/assets/delete.svg deleted file mode 100644 index deb1055..0000000 --- a/crates/ui/src/icons/assets/delete.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/download.svg b/crates/ui/src/icons/assets/download.svg deleted file mode 100644 index 5c75527..0000000 --- a/crates/ui/src/icons/assets/download.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/crates/ui/src/icons/assets/ellipsis-vertical.svg b/crates/ui/src/icons/assets/ellipsis-vertical.svg index 47e8471..a182172 100644 --- a/crates/ui/src/icons/assets/ellipsis-vertical.svg +++ b/crates/ui/src/icons/assets/ellipsis-vertical.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/crates/ui/src/icons/assets/ellipsis.svg b/crates/ui/src/icons/assets/ellipsis.svg deleted file mode 100644 index 851b590..0000000 --- a/crates/ui/src/icons/assets/ellipsis.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/external-link.svg b/crates/ui/src/icons/assets/external-link.svg deleted file mode 100644 index b6fbc8b..0000000 --- a/crates/ui/src/icons/assets/external-link.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/eye-off.svg b/crates/ui/src/icons/assets/eye-off.svg index ab2c9f0..907673c 100644 --- a/crates/ui/src/icons/assets/eye-off.svg +++ b/crates/ui/src/icons/assets/eye-off.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/crates/ui/src/icons/assets/eye.svg b/crates/ui/src/icons/assets/eye.svg index cec895d..b282fee 100644 --- a/crates/ui/src/icons/assets/eye.svg +++ b/crates/ui/src/icons/assets/eye.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/crates/ui/src/icons/assets/file.svg b/crates/ui/src/icons/assets/file.svg index 9fd0ca6..bf1ab59 100644 --- a/crates/ui/src/icons/assets/file.svg +++ b/crates/ui/src/icons/assets/file.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/crates/ui/src/icons/assets/filter.svg b/crates/ui/src/icons/assets/filter.svg deleted file mode 100644 index 20829cb..0000000 --- a/crates/ui/src/icons/assets/filter.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/folder-closed.svg b/crates/ui/src/icons/assets/folder-closed.svg deleted file mode 100644 index 7f1eaeb..0000000 --- a/crates/ui/src/icons/assets/folder-closed.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/folder-open.svg b/crates/ui/src/icons/assets/folder-open.svg deleted file mode 100644 index db7f94b..0000000 --- a/crates/ui/src/icons/assets/folder-open.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/folder.svg b/crates/ui/src/icons/assets/folder.svg index e0edfdd..d8290b5 100644 --- a/crates/ui/src/icons/assets/folder.svg +++ b/crates/ui/src/icons/assets/folder.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/crates/ui/src/icons/assets/frame.svg b/crates/ui/src/icons/assets/frame.svg deleted file mode 100644 index c799622..0000000 --- a/crates/ui/src/icons/assets/frame.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/gallery-vertical-end.svg b/crates/ui/src/icons/assets/gallery-vertical-end.svg deleted file mode 100644 index 0c3b5b7..0000000 --- a/crates/ui/src/icons/assets/gallery-vertical-end.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/git-branch.svg b/crates/ui/src/icons/assets/git-branch.svg index 69f6b1a..31911fe 100644 --- a/crates/ui/src/icons/assets/git-branch.svg +++ b/crates/ui/src/icons/assets/git-branch.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/crates/ui/src/icons/assets/git-clone.svg b/crates/ui/src/icons/assets/git-clone.svg index 0fa1753..a3232cc 100644 --- a/crates/ui/src/icons/assets/git-clone.svg +++ b/crates/ui/src/icons/assets/git-clone.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/crates/ui/src/icons/assets/git-commit.svg b/crates/ui/src/icons/assets/git-commit.svg index 931e995..69dc523 100644 --- a/crates/ui/src/icons/assets/git-commit.svg +++ b/crates/ui/src/icons/assets/git-commit.svg @@ -1,3 +1,3 @@ - + diff --git a/crates/ui/src/icons/assets/git-file.svg b/crates/ui/src/icons/assets/git-file.svg deleted file mode 100644 index c98599d..0000000 --- a/crates/ui/src/icons/assets/git-file.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/git-issue-close.svg b/crates/ui/src/icons/assets/git-issue-close.svg deleted file mode 100644 index 1468023..0000000 --- a/crates/ui/src/icons/assets/git-issue-close.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/git-issue-closed.svg b/crates/ui/src/icons/assets/git-issue-closed.svg new file mode 100644 index 0000000..101f9e4 --- /dev/null +++ b/crates/ui/src/icons/assets/git-issue-closed.svg @@ -0,0 +1,3 @@ + + + diff --git a/crates/ui/src/icons/assets/git-issue-done.svg b/crates/ui/src/icons/assets/git-issue-done.svg index d793147..4e9aa91 100644 --- a/crates/ui/src/icons/assets/git-issue-done.svg +++ b/crates/ui/src/icons/assets/git-issue-done.svg @@ -1,3 +1,3 @@ - + diff --git a/crates/ui/src/icons/assets/git-issue-ongoing.svg b/crates/ui/src/icons/assets/git-issue-ongoing.svg index 040d1a2..bbc8e5d 100644 --- a/crates/ui/src/icons/assets/git-issue-ongoing.svg +++ b/crates/ui/src/icons/assets/git-issue-ongoing.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/crates/ui/src/icons/assets/git-issue-open.svg b/crates/ui/src/icons/assets/git-issue-open.svg deleted file mode 100644 index 22b9465..0000000 --- a/crates/ui/src/icons/assets/git-issue-open.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/git-pull-request-closed.svg b/crates/ui/src/icons/assets/git-pull-request-closed.svg index 84eab1f..6790366 100644 --- a/crates/ui/src/icons/assets/git-pull-request-closed.svg +++ b/crates/ui/src/icons/assets/git-pull-request-closed.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/crates/ui/src/icons/assets/git-pull-request-draft.svg b/crates/ui/src/icons/assets/git-pull-request-draft.svg index df1fc0e..d50e253 100644 --- a/crates/ui/src/icons/assets/git-pull-request-draft.svg +++ b/crates/ui/src/icons/assets/git-pull-request-draft.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/crates/ui/src/icons/assets/git-pull-request-merged.svg b/crates/ui/src/icons/assets/git-pull-request-merged.svg index 7ff4a1f..4852799 100644 --- a/crates/ui/src/icons/assets/git-pull-request-merged.svg +++ b/crates/ui/src/icons/assets/git-pull-request-merged.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/crates/ui/src/icons/assets/git-pull-request.svg b/crates/ui/src/icons/assets/git-pull-request.svg index 8d5cb60..6264b9a 100644 --- a/crates/ui/src/icons/assets/git-pull-request.svg +++ b/crates/ui/src/icons/assets/git-pull-request.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/crates/ui/src/icons/assets/github.svg b/crates/ui/src/icons/assets/github.svg deleted file mode 100644 index 7b3bfb7..0000000 --- a/crates/ui/src/icons/assets/github.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/global-on.svg b/crates/ui/src/icons/assets/global-on.svg deleted file mode 100644 index 40fc5ec..0000000 --- a/crates/ui/src/icons/assets/global-on.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/globe.svg b/crates/ui/src/icons/assets/globe.svg deleted file mode 100644 index 40fc5ec..0000000 --- a/crates/ui/src/icons/assets/globe.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/grid.svg b/crates/ui/src/icons/assets/grid.svg index ecf1466..296c515 100644 --- a/crates/ui/src/icons/assets/grid.svg +++ b/crates/ui/src/icons/assets/grid.svg @@ -1,3 +1,3 @@ - + diff --git a/crates/ui/src/icons/assets/hard-drive.svg b/crates/ui/src/icons/assets/hard-drive.svg deleted file mode 100644 index 542b77c..0000000 --- a/crates/ui/src/icons/assets/hard-drive.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/heart-off.svg b/crates/ui/src/icons/assets/heart-off.svg deleted file mode 100644 index 444628f..0000000 --- a/crates/ui/src/icons/assets/heart-off.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/heart.svg b/crates/ui/src/icons/assets/heart.svg deleted file mode 100644 index 83d1af5..0000000 --- a/crates/ui/src/icons/assets/heart.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/house.svg b/crates/ui/src/icons/assets/house.svg deleted file mode 100644 index 10e4097..0000000 --- a/crates/ui/src/icons/assets/house.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/crates/ui/src/icons/assets/image.svg b/crates/ui/src/icons/assets/image.svg deleted file mode 100644 index 3241134..0000000 --- a/crates/ui/src/icons/assets/image.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/crates/ui/src/icons/assets/inbox.svg b/crates/ui/src/icons/assets/inbox.svg index 6e9b642..79cee54 100644 --- a/crates/ui/src/icons/assets/inbox.svg +++ b/crates/ui/src/icons/assets/inbox.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/crates/ui/src/icons/assets/info.svg b/crates/ui/src/icons/assets/info.svg deleted file mode 100644 index 73fa694..0000000 --- a/crates/ui/src/icons/assets/info.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/init.svg b/crates/ui/src/icons/assets/init.svg deleted file mode 100644 index 060c043..0000000 --- a/crates/ui/src/icons/assets/init.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/inspector.svg b/crates/ui/src/icons/assets/inspector.svg deleted file mode 100644 index d61e916..0000000 --- a/crates/ui/src/icons/assets/inspector.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/layout-dashboard.svg b/crates/ui/src/icons/assets/layout-dashboard.svg deleted file mode 100644 index 53afe50..0000000 --- a/crates/ui/src/icons/assets/layout-dashboard.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/layout-grid.svg b/crates/ui/src/icons/assets/layout-grid.svg deleted file mode 100644 index f8eca3a..0000000 --- a/crates/ui/src/icons/assets/layout-grid.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - diff --git a/crates/ui/src/icons/assets/link.svg b/crates/ui/src/icons/assets/link.svg deleted file mode 100644 index 645e746..0000000 --- a/crates/ui/src/icons/assets/link.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/crates/ui/src/icons/assets/list.svg b/crates/ui/src/icons/assets/list.svg deleted file mode 100644 index 0d88fb1..0000000 --- a/crates/ui/src/icons/assets/list.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - diff --git a/crates/ui/src/icons/assets/loader-circle.svg b/crates/ui/src/icons/assets/loader-circle.svg deleted file mode 100644 index 55e4ea5..0000000 --- a/crates/ui/src/icons/assets/loader-circle.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/loader.svg b/crates/ui/src/icons/assets/loader.svg index 185f0af..3416590 100644 --- a/crates/ui/src/icons/assets/loader.svg +++ b/crates/ui/src/icons/assets/loader.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/crates/ui/src/icons/assets/lock-open.svg b/crates/ui/src/icons/assets/lock-open.svg deleted file mode 100644 index b236712..0000000 --- a/crates/ui/src/icons/assets/lock-open.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/crates/ui/src/icons/assets/lock.svg b/crates/ui/src/icons/assets/lock.svg deleted file mode 100644 index b2b32d1..0000000 --- a/crates/ui/src/icons/assets/lock.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/crates/ui/src/icons/assets/mail.svg b/crates/ui/src/icons/assets/mail.svg deleted file mode 100644 index 4cff729..0000000 --- a/crates/ui/src/icons/assets/mail.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/crates/ui/src/icons/assets/map.svg b/crates/ui/src/icons/assets/map.svg deleted file mode 100644 index a5425db..0000000 --- a/crates/ui/src/icons/assets/map.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/markdown.svg b/crates/ui/src/icons/assets/markdown.svg index f11c48f..48c614b 100644 --- a/crates/ui/src/icons/assets/markdown.svg +++ b/crates/ui/src/icons/assets/markdown.svg @@ -1,3 +1,3 @@ - + diff --git a/crates/ui/src/icons/assets/maximize.svg b/crates/ui/src/icons/assets/maximize.svg deleted file mode 100644 index 398a8c3..0000000 --- a/crates/ui/src/icons/assets/maximize.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/memory-stick.svg b/crates/ui/src/icons/assets/memory-stick.svg deleted file mode 100644 index cddb282..0000000 --- a/crates/ui/src/icons/assets/memory-stick.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/menu.svg b/crates/ui/src/icons/assets/menu.svg deleted file mode 100644 index 2f00246..0000000 --- a/crates/ui/src/icons/assets/menu.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/mic.svg b/crates/ui/src/icons/assets/mic.svg deleted file mode 100644 index 351c1b6..0000000 --- a/crates/ui/src/icons/assets/mic.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/crates/ui/src/icons/assets/microphone.svg b/crates/ui/src/icons/assets/microphone.svg new file mode 100644 index 0000000..5119a71 --- /dev/null +++ b/crates/ui/src/icons/assets/microphone.svg @@ -0,0 +1,3 @@ + + + diff --git a/crates/ui/src/icons/assets/minimize.svg b/crates/ui/src/icons/assets/minimize.svg deleted file mode 100644 index 51b44e4..0000000 --- a/crates/ui/src/icons/assets/minimize.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/minus.svg b/crates/ui/src/icons/assets/minus.svg deleted file mode 100644 index 1bd2a89..0000000 --- a/crates/ui/src/icons/assets/minus.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/moon.svg b/crates/ui/src/icons/assets/moon.svg deleted file mode 100644 index c991f89..0000000 --- a/crates/ui/src/icons/assets/moon.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/more.svg b/crates/ui/src/icons/assets/more.svg new file mode 100644 index 0000000..4f413d9 --- /dev/null +++ b/crates/ui/src/icons/assets/more.svg @@ -0,0 +1,3 @@ + + + diff --git a/crates/ui/src/icons/assets/network.svg b/crates/ui/src/icons/assets/network.svg deleted file mode 100644 index 6587f86..0000000 --- a/crates/ui/src/icons/assets/network.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/palette.svg b/crates/ui/src/icons/assets/palette.svg deleted file mode 100644 index d7a32e8..0000000 --- a/crates/ui/src/icons/assets/palette.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/panel-bottom-open.svg b/crates/ui/src/icons/assets/panel-bottom-open.svg deleted file mode 100644 index 58cb22a..0000000 --- a/crates/ui/src/icons/assets/panel-bottom-open.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/panel-bottom.svg b/crates/ui/src/icons/assets/panel-bottom.svg deleted file mode 100644 index e017db3..0000000 --- a/crates/ui/src/icons/assets/panel-bottom.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/panel-left-close.svg b/crates/ui/src/icons/assets/panel-left-close.svg deleted file mode 100644 index 6cac95c..0000000 --- a/crates/ui/src/icons/assets/panel-left-close.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/panel-left-open.svg b/crates/ui/src/icons/assets/panel-left-open.svg deleted file mode 100644 index 62bae09..0000000 --- a/crates/ui/src/icons/assets/panel-left-open.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/panel-left.svg b/crates/ui/src/icons/assets/panel-left.svg deleted file mode 100644 index 6cac95c..0000000 --- a/crates/ui/src/icons/assets/panel-left.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/panel-right-close.svg b/crates/ui/src/icons/assets/panel-right-close.svg deleted file mode 100644 index 5fe9dcd..0000000 --- a/crates/ui/src/icons/assets/panel-right-close.svg +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/crates/ui/src/icons/assets/panel-right-open.svg b/crates/ui/src/icons/assets/panel-right-open.svg deleted file mode 100644 index 3b5ff0b..0000000 --- a/crates/ui/src/icons/assets/panel-right-open.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/crates/ui/src/icons/assets/panel-right.svg b/crates/ui/src/icons/assets/panel-right.svg deleted file mode 100644 index d37f5e7..0000000 --- a/crates/ui/src/icons/assets/panel-right.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/pause.svg b/crates/ui/src/icons/assets/pause.svg deleted file mode 100644 index b9a49e5..0000000 --- a/crates/ui/src/icons/assets/pause.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/pencil.svg b/crates/ui/src/icons/assets/pencil.svg deleted file mode 100644 index 7384498..0000000 --- a/crates/ui/src/icons/assets/pencil.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/crates/ui/src/icons/assets/pin.svg b/crates/ui/src/icons/assets/pin.svg deleted file mode 100644 index 04bc7cb..0000000 --- a/crates/ui/src/icons/assets/pin.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/crates/ui/src/icons/assets/play.svg b/crates/ui/src/icons/assets/play.svg deleted file mode 100644 index 57b5217..0000000 --- a/crates/ui/src/icons/assets/play.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/plus.svg b/crates/ui/src/icons/assets/plus.svg index c4f4bd7..21cf176 100644 --- a/crates/ui/src/icons/assets/plus.svg +++ b/crates/ui/src/icons/assets/plus.svg @@ -1,3 +1,3 @@ - + diff --git a/crates/ui/src/icons/assets/printer.svg b/crates/ui/src/icons/assets/printer.svg deleted file mode 100644 index dfa0a60..0000000 --- a/crates/ui/src/icons/assets/printer.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/crates/ui/src/icons/assets/recent.svg b/crates/ui/src/icons/assets/recent.svg deleted file mode 100644 index e7c76e6..0000000 --- a/crates/ui/src/icons/assets/recent.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/redo-2.svg b/crates/ui/src/icons/assets/redo-2.svg deleted file mode 100644 index 51c616b..0000000 --- a/crates/ui/src/icons/assets/redo-2.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/redo.svg b/crates/ui/src/icons/assets/redo.svg deleted file mode 100644 index 7a89cf8..0000000 --- a/crates/ui/src/icons/assets/redo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/refresh-cw.svg b/crates/ui/src/icons/assets/refresh-cw.svg deleted file mode 100644 index c27b3a9..0000000 --- a/crates/ui/src/icons/assets/refresh-cw.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - diff --git a/crates/ui/src/icons/assets/refresh.svg b/crates/ui/src/icons/assets/refresh.svg index b7ec11e..f2bed4e 100644 --- a/crates/ui/src/icons/assets/refresh.svg +++ b/crates/ui/src/icons/assets/refresh.svg @@ -1,3 +1,3 @@ - + diff --git a/crates/ui/src/icons/assets/replace.svg b/crates/ui/src/icons/assets/replace.svg deleted file mode 100644 index fecb76d..0000000 --- a/crates/ui/src/icons/assets/replace.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/resize-corner.svg b/crates/ui/src/icons/assets/resize-corner.svg deleted file mode 100644 index 9d3eef0..0000000 --- a/crates/ui/src/icons/assets/resize-corner.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/save.svg b/crates/ui/src/icons/assets/save.svg deleted file mode 100644 index 07af070..0000000 --- a/crates/ui/src/icons/assets/save.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/crates/ui/src/icons/assets/scissors.svg b/crates/ui/src/icons/assets/scissors.svg deleted file mode 100644 index f87bf20..0000000 --- a/crates/ui/src/icons/assets/scissors.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - diff --git a/crates/ui/src/icons/assets/search.svg b/crates/ui/src/icons/assets/search.svg index 07f3ac0..ff88e0e 100644 --- a/crates/ui/src/icons/assets/search.svg +++ b/crates/ui/src/icons/assets/search.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/crates/ui/src/icons/assets/send.svg b/crates/ui/src/icons/assets/send.svg deleted file mode 100644 index 001843b..0000000 --- a/crates/ui/src/icons/assets/send.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/crates/ui/src/icons/assets/settings-2.svg b/crates/ui/src/icons/assets/settings-2.svg deleted file mode 100644 index 8c0b6d1..0000000 --- a/crates/ui/src/icons/assets/settings-2.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/settings.svg b/crates/ui/src/icons/assets/settings.svg index cb2a6ac..84f6e69 100644 --- a/crates/ui/src/icons/assets/settings.svg +++ b/crates/ui/src/icons/assets/settings.svg @@ -1,3 +1,3 @@ - + diff --git a/crates/ui/src/icons/assets/share.svg b/crates/ui/src/icons/assets/share.svg deleted file mode 100644 index c91f073..0000000 --- a/crates/ui/src/icons/assets/share.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/sort-ascending.svg b/crates/ui/src/icons/assets/sort-ascending.svg deleted file mode 100644 index 268a8b0..0000000 --- a/crates/ui/src/icons/assets/sort-ascending.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/sort-descending.svg b/crates/ui/src/icons/assets/sort-descending.svg deleted file mode 100644 index 11ab2d7..0000000 --- a/crates/ui/src/icons/assets/sort-descending.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/square-terminal.svg b/crates/ui/src/icons/assets/square-terminal.svg deleted file mode 100644 index 1bc4c89..0000000 --- a/crates/ui/src/icons/assets/square-terminal.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/square.svg b/crates/ui/src/icons/assets/square.svg deleted file mode 100644 index 7862733..0000000 --- a/crates/ui/src/icons/assets/square.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/stack.svg b/crates/ui/src/icons/assets/stack.svg new file mode 100644 index 0000000..4f3ef47 --- /dev/null +++ b/crates/ui/src/icons/assets/stack.svg @@ -0,0 +1,3 @@ + + + diff --git a/crates/ui/src/icons/assets/star-fill.svg b/crates/ui/src/icons/assets/star-fill.svg deleted file mode 100644 index 4bd4c08..0000000 --- a/crates/ui/src/icons/assets/star-fill.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/star-off.svg b/crates/ui/src/icons/assets/star-off.svg deleted file mode 100644 index 6afff2f..0000000 --- a/crates/ui/src/icons/assets/star-off.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/crates/ui/src/icons/assets/star.svg b/crates/ui/src/icons/assets/star.svg deleted file mode 100644 index 0a13c9e..0000000 --- a/crates/ui/src/icons/assets/star.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/stop.svg b/crates/ui/src/icons/assets/stop.svg new file mode 100644 index 0000000..84f6e69 --- /dev/null +++ b/crates/ui/src/icons/assets/stop.svg @@ -0,0 +1,3 @@ + + + diff --git a/crates/ui/src/icons/assets/sun.svg b/crates/ui/src/icons/assets/sun.svg deleted file mode 100644 index 8dfd5e3..0000000 --- a/crates/ui/src/icons/assets/sun.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/tag.svg b/crates/ui/src/icons/assets/tag.svg deleted file mode 100644 index e84a0c5..0000000 --- a/crates/ui/src/icons/assets/tag.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/text-align-center.svg b/crates/ui/src/icons/assets/text-align-center.svg deleted file mode 100644 index a7b6d53..0000000 --- a/crates/ui/src/icons/assets/text-align-center.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/crates/ui/src/icons/assets/text-align-end.svg b/crates/ui/src/icons/assets/text-align-end.svg deleted file mode 100644 index fba40f3..0000000 --- a/crates/ui/src/icons/assets/text-align-end.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/crates/ui/src/icons/assets/text-align-start.svg b/crates/ui/src/icons/assets/text-align-start.svg deleted file mode 100644 index 703d455..0000000 --- a/crates/ui/src/icons/assets/text-align-start.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/crates/ui/src/icons/assets/thumbs-down.svg b/crates/ui/src/icons/assets/thumbs-down.svg deleted file mode 100644 index da52354..0000000 --- a/crates/ui/src/icons/assets/thumbs-down.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/thumbs-up.svg b/crates/ui/src/icons/assets/thumbs-up.svg deleted file mode 100644 index 8715ad7..0000000 --- a/crates/ui/src/icons/assets/thumbs-up.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/trash.svg b/crates/ui/src/icons/assets/trash.svg deleted file mode 100644 index 076517c..0000000 --- a/crates/ui/src/icons/assets/trash.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/crates/ui/src/icons/assets/trending.svg b/crates/ui/src/icons/assets/trending.svg index 314cd1f..2374454 100644 --- a/crates/ui/src/icons/assets/trending.svg +++ b/crates/ui/src/icons/assets/trending.svg @@ -1,3 +1,3 @@ - + diff --git a/crates/ui/src/icons/assets/triangle-alert.svg b/crates/ui/src/icons/assets/triangle-alert.svg deleted file mode 100644 index b456b4d..0000000 --- a/crates/ui/src/icons/assets/triangle-alert.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/undo-2.svg b/crates/ui/src/icons/assets/undo-2.svg deleted file mode 100644 index e2ab153..0000000 --- a/crates/ui/src/icons/assets/undo-2.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/undo.svg b/crates/ui/src/icons/assets/undo.svg deleted file mode 100644 index 396852a..0000000 --- a/crates/ui/src/icons/assets/undo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/unlock.svg b/crates/ui/src/icons/assets/unlock.svg index c62caa1..3f1c2ad 100644 --- a/crates/ui/src/icons/assets/unlock.svg +++ b/crates/ui/src/icons/assets/unlock.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/crates/ui/src/icons/assets/user.svg b/crates/ui/src/icons/assets/user.svg deleted file mode 100644 index fd4dea4..0000000 --- a/crates/ui/src/icons/assets/user.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/volume-2.svg b/crates/ui/src/icons/assets/volume-2.svg deleted file mode 100644 index 519e6cb..0000000 --- a/crates/ui/src/icons/assets/volume-2.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/crates/ui/src/icons/assets/volume-x.svg b/crates/ui/src/icons/assets/volume-x.svg deleted file mode 100644 index 3e26009..0000000 --- a/crates/ui/src/icons/assets/volume-x.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/crates/ui/src/icons/assets/warning.svg b/crates/ui/src/icons/assets/warning.svg new file mode 100644 index 0000000..3a3c1ba --- /dev/null +++ b/crates/ui/src/icons/assets/warning.svg @@ -0,0 +1,3 @@ + + + diff --git a/crates/ui/src/icons/assets/window-close.svg b/crates/ui/src/icons/assets/window-close.svg deleted file mode 100644 index 4ee8e56..0000000 --- a/crates/ui/src/icons/assets/window-close.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/crates/ui/src/icons/assets/window-maximize.svg b/crates/ui/src/icons/assets/window-maximize.svg index b5a3265..a9d9f29 100644 --- a/crates/ui/src/icons/assets/window-maximize.svg +++ b/crates/ui/src/icons/assets/window-maximize.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/crates/ui/src/icons/assets/window-minimize.svg b/crates/ui/src/icons/assets/window-minimize.svg index fcc1e94..a9d9f29 100644 --- a/crates/ui/src/icons/assets/window-minimize.svg +++ b/crates/ui/src/icons/assets/window-minimize.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/crates/ui/src/icons/assets/window-restore.svg b/crates/ui/src/icons/assets/window-restore.svg index f55fa10..a9d9f29 100644 --- a/crates/ui/src/icons/assets/window-restore.svg +++ b/crates/ui/src/icons/assets/window-restore.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/crates/ui/src/icons/assets/x.svg b/crates/ui/src/icons/assets/x.svg deleted file mode 100644 index e317943..0000000 --- a/crates/ui/src/icons/assets/x.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/crates/ui/src/icons/assets/zoom-in.svg b/crates/ui/src/icons/assets/zoom-in.svg deleted file mode 100644 index 11173c0..0000000 --- a/crates/ui/src/icons/assets/zoom-in.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - diff --git a/crates/ui/src/icons/assets/zoom-out.svg b/crates/ui/src/icons/assets/zoom-out.svg deleted file mode 100644 index 70abec4..0000000 --- a/crates/ui/src/icons/assets/zoom-out.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/crates/ui/src/icons/freedesktop.rs b/crates/ui/src/icons/freedesktop.rs deleted file mode 100644 index c386745..0000000 --- a/crates/ui/src/icons/freedesktop.rs +++ /dev/null @@ -1,276 +0,0 @@ -//! Linux resolver: freedesktop icon-theme lookup (active theme → its -//! inherits → hicolor), painting the found SVG through gpui. The lookup is -//! pure, so fixtures run on every OS; theme discovery lives behind the Linux cfg. - -use std::collections::HashMap; -use std::path::{Path, PathBuf}; -use std::sync::{Mutex, OnceLock, PoisonError}; - -use gpui::SharedString; - -use crate::icons::IconRole; - -/// Directory-name ranking when matching the requested size. -#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)] -enum SizeScore { - Scalable, - Exact(u32), - Any, -} - -fn size_score(directory: &str, requested: u32) -> SizeScore { - if directory == "scalable" { - return SizeScore::Scalable; - } - let digits: String = directory.chars().take_while(char::is_ascii_digit).collect(); - match digits.parse::() { - Ok(found) => SizeScore::Exact(found.abs_diff(requested)), - Err(_) => SizeScore::Any, - } -} - -/// Walks the theme's inherits chain (capped) plus `hicolor`. -/// -/// Preferring the theme's own candidates over the fallback theme's. -pub(crate) fn lookup( - candidates: &[&str], - theme: &str, - requested: u32, - base_dirs: &[PathBuf], -) -> Option { - let mut themes = vec![theme.to_string()]; - let mut index = 0; - - while themes.len() < 5 && index < themes.len() { - if let Some(parents) = inherits(&themes[index], base_dirs) { - themes.extend(parents); - } - index += 1; - } - themes.push("hicolor".to_string()); - - for theme in &themes { - for name in candidates { - if let Some(path) = find_named(base_dirs, theme, name, requested) { - return Some(path); - } - } - } - - None -} - -fn inherits(theme: &str, base_dirs: &[PathBuf]) -> Option> { - let index = base_dirs - .iter() - .map(|base| base.join(theme).join("index.theme")) - .find(|index| index.is_file())?; - - let text = std::fs::read_to_string(index).ok()?; - let line = text - .lines() - .find(|line| line.trim().starts_with("Inherits="))?; - - Some( - line.trim() - .strip_prefix("Inherits=")? - .split(',') - .map(str::trim) - .filter(|name| !name.is_empty()) - .map(str::to_string) - .collect(), - ) -} - -fn find_named(base_dirs: &[PathBuf], theme: &str, name: &str, requested: u32) -> Option { - let mut best: Option<(SizeScore, PathBuf)> = None; - for base in base_dirs { - search_directory(&base.join(theme), name, requested, 0, &mut best); - } - best.map(|(_, path)| path) -} - -/// Search directory recursively with bounded depth. -fn search_directory( - directory: &Path, - name: &str, - requested: u32, - depth: usize, - best: &mut Option<(SizeScore, PathBuf)>, -) { - if depth > 2 { - return; - } - - let Ok(entries) = std::fs::read_dir(directory) else { - return; - }; - - let icon = format!("{name}.svg"); - - for entry in entries.flatten() { - let path = entry.path(); - if path.is_dir() { - search_directory(&path, name, requested, depth + 1, best); - } else if path.file_name().is_some_and(|file| *file == *icon) { - let score = icon_score(&path, requested); - if best - .as_ref() - .is_none_or(|(best_score, _)| score < *best_score) - { - *best = Some((score, path)); - } - } - } -} - -/// Scores from the icon's parent and grandparent directory names, -/// whichever carries the size (`scalable`, `16x16`, `24`, etc.). -fn icon_score(path: &Path, requested: u32) -> SizeScore { - let parent = path - .parent() - .and_then(|parent| parent.file_name()) - .and_then(|name| name.to_str()); - - let grandparent = path - .parent() - .and_then(|parent| parent.parent()) - .and_then(|parent| parent.file_name()) - .and_then(|name| name.to_str()); - - [parent, grandparent] - .into_iter() - .flatten() - .map(|name| size_score(name, requested)) - .min() - .unwrap_or(SizeScore::Any) -} - -/// A resolved icon file and the asset key its bytes are served under. -struct CachedIcon { - path: PathBuf, - asset_key: SharedString, -} - -/// The discovered icons, cached for the process. -type IconCache = Mutex>>; - -pub(crate) fn cached_file(role: IconRole, requested: u32) -> Option { - cached_icon(role, requested, |icon| icon.path.clone()) -} - -/// The asset key a resolved freedesktop file is served under. -pub(crate) fn cached_asset_key(role: IconRole, requested: u32) -> Option { - cached_icon(role, requested, |icon| icon.asset_key.clone()) -} - -fn cached_icon(role: IconRole, requested: u32, project: P) -> Option -where - P: FnOnce(&CachedIcon) -> T, -{ - static CACHE: OnceLock = OnceLock::new(); - - let cache = CACHE.get_or_init(|| Mutex::new(HashMap::new())); - // A poisoned lock means a lookup panicked; its stale data beats a panic. - let mut cache = cache.lock().unwrap_or_else(PoisonError::into_inner); - - cache - .entry((role.slug(), requested)) - .or_insert_with(|| { - lookup( - role.freedesktop_names(), - &active_theme(), - requested, - &base_dirs(), - ) - .map(|path| CachedIcon { - asset_key: SharedString::from(format!( - "icons/freedesktop/{}-{requested}.svg", - role.slug() - )), - path, - }) - }) - .as_ref() - .map(project) -} - -#[cfg(target_os = "linux")] -mod discovery { - use std::path::PathBuf; - - fn home_dir() -> Option { - std::env::var_os("HOME").map(PathBuf::from) - } - - /// `$HOME/.icons`, `$XDG_DATA_HOME/icons`, `$XDG_DATA_DIRS/icons`. - pub(crate) fn base_dirs() -> Vec { - let mut dirs = Vec::new(); - if let Some(home) = home_dir() { - dirs.push(home.join(".icons")); - dirs.push(home.join(".local/share/icons")); - } - let data_dirs = std::env::var("XDG_DATA_DIRS") - .unwrap_or_else(|_| "/usr/local/share:/usr/share".to_string()); - for data_dir in data_dirs.split(':').filter(|dir| !dir.is_empty()) { - dirs.push(PathBuf::from(data_dir).join("icons")); - } - dirs - } - - fn gsettings_icon_theme() -> Option { - let output = std::process::Command::new("gsettings") - .args(["get", "org.gnome.desktop.interface", "icon-theme"]) - .output() - .ok()?; - if !output.status.success() { - return None; - } - let value = String::from_utf8(output.stdout).ok()?; - Some(value.trim().trim_matches('\'').trim().to_string()) - } - - fn kdeglobals_icon_theme() -> Option { - let text = std::fs::read_to_string(home_dir()?.join(".config/kdeglobals")).ok()?; - let mut section = None; - for line in text.lines() { - let line = line.trim(); - if let Some(rest) = line.strip_prefix('[') { - section = Some(rest.split(']').next().unwrap_or(rest).trim().to_string()); - } else if section.as_deref() == Some("Icons") - && let Some((key, value)) = line.split_once('=') - && key.trim() == "Theme" - { - return Some(value.trim().to_string()); - } - } - None - } - - fn omarchy_icon_theme() -> Option { - let path = home_dir()?.join(".local/state/omarchy/current/theme/icons.theme"); - let text = std::fs::read_to_string(path).ok()?; - Some(text.trim().to_string()) - } - - pub(crate) fn active_theme() -> String { - omarchy_icon_theme() - .or_else(kdeglobals_icon_theme) - .or_else(gsettings_icon_theme) - .filter(|theme| !theme.is_empty()) - .unwrap_or_else(|| "Adwaita".to_string()) - } -} - -#[cfg(target_os = "linux")] -use discovery::{active_theme, base_dirs}; - -#[cfg(not(target_os = "linux"))] -fn active_theme() -> String { - "Adwaita".to_string() -} - -#[cfg(not(target_os = "linux"))] -fn base_dirs() -> Vec { - Vec::new() -} diff --git a/crates/ui/src/icons/mod.rs b/crates/ui/src/icons/mod.rs index 695ba68..6ac4caa 100644 --- a/crates/ui/src/icons/mod.rs +++ b/crates/ui/src/icons/mod.rs @@ -1,4 +1,4 @@ -//! Signed's icon set: semantic roles plus app glyphs, resolved per platform. +//! Signed's icon set: application-defined SVG glyphs. use std::time::Duration; @@ -8,11 +8,6 @@ use gpui::{ SharedString, Styled as _, TimedTransformation, Transformation, Window, div, px, svg, }; -#[cfg_attr(not(target_os = "linux"), allow(dead_code))] -mod freedesktop; -#[cfg_attr(not(target_os = "windows"), allow(dead_code))] -mod segoe; - const SMALL_ICON_SIZE: Pixels = px(14.0); const DEFAULT_ICON_SIZE: Pixels = px(16.0); const LARGE_ICON_SIZE: Pixels = px(20.0); @@ -25,20 +20,14 @@ pub enum IconRole { Check, Close, ChevronDown, - ChevronLeft, ChevronRight, - ChevronUp, Plus, - Minus, Search, Folder, Warning, - Info, Copy, Eye, EyeOff, - PanelLeft, - PanelRight, WindowMinimize, WindowMaximize, WindowRestore, @@ -47,57 +36,14 @@ pub enum IconRole { Stop, Settings, Refresh, - Undo, - Redo, - ZoomIn, - ZoomOut, - Trash, - Edit, - Save, - Download, - Share, - Send, - Print, - EnterFullScreen, - ExitFullScreen, - Cut, - Paste, - Sort, - Home, - Menu, More, Grid, - List, File, - Image, - Calendar, Clock, - User, - Lock, Unlock, - Star, - Heart, - Pin, - Mail, - Link, - Play, - Pause, - Help, - Volume, - VolumeMuted, - AlignLeft, - AlignCenter, - AlignRight, - Sun, - Moon, CirclePlus, - Filter, - GlobalOn, - GlobalOff, - GitFile, GitCommit, GitIssueDone, - GitIssueOpen, GitIssueClosed, GitIssueOngoing, GitPullRequest, @@ -106,209 +52,29 @@ pub enum IconRole { GitPullRequestMerged, GitClone, GitBranch, - Tag, Markdown, Trending, - Recent, - Init, EllipsisVertical, ArrowUp, - Globe, Inbox, + Stack, } impl IconRole { - pub fn all() -> &'static [Self] { - &[ - Self::Check, - Self::Close, - Self::ChevronDown, - Self::ChevronLeft, - Self::ChevronRight, - Self::ChevronUp, - Self::Plus, - Self::Minus, - Self::Search, - Self::Folder, - Self::Warning, - Self::Info, - Self::Copy, - Self::Eye, - Self::EyeOff, - Self::PanelLeft, - Self::PanelRight, - Self::WindowMinimize, - Self::WindowMaximize, - Self::WindowRestore, - Self::Loader, - Self::Microphone, - Self::Stop, - Self::Settings, - Self::Refresh, - Self::Undo, - Self::Redo, - Self::ZoomIn, - Self::ZoomOut, - Self::Trash, - Self::Edit, - Self::Save, - Self::Download, - Self::Share, - Self::Send, - Self::Print, - Self::EnterFullScreen, - Self::ExitFullScreen, - Self::Cut, - Self::Paste, - Self::Sort, - Self::Home, - Self::Menu, - Self::More, - Self::Grid, - Self::List, - Self::File, - Self::Image, - Self::Calendar, - Self::Clock, - Self::User, - Self::Lock, - Self::Unlock, - Self::Star, - Self::Heart, - Self::Pin, - Self::Mail, - Self::Link, - Self::Play, - Self::Pause, - Self::Help, - Self::Volume, - Self::VolumeMuted, - Self::AlignLeft, - Self::AlignCenter, - Self::AlignRight, - Self::Sun, - Self::Moon, - ] - } - - fn asset_path(self) -> &'static str { - match self { - Self::Check => "icons/check.svg", - Self::Close => "icons/x.svg", - Self::ChevronDown => "icons/chevron-down.svg", - Self::ChevronLeft => "icons/chevron-left.svg", - Self::ChevronRight => "icons/chevron-right.svg", - Self::ChevronUp => "icons/chevron-up.svg", - Self::Plus => "icons/plus.svg", - Self::Minus => "icons/minus.svg", - Self::Search => "icons/search.svg", - Self::Folder => "icons/folder.svg", - Self::Warning => "icons/triangle-alert.svg", - Self::Info => "icons/info.svg", - Self::Copy => "icons/copy.svg", - Self::Eye => "icons/eye.svg", - Self::EyeOff => "icons/eye-off.svg", - Self::PanelLeft => "icons/panel-left.svg", - Self::PanelRight => "icons/panel-right.svg", - Self::WindowMinimize => "icons/minus.svg", - Self::WindowMaximize => "icons/square.svg", - Self::WindowRestore => "icons/copy.svg", - Self::Loader => "icons/loader.svg", - Self::Microphone => "icons/mic.svg", - Self::Stop => "icons/square.svg", - Self::Settings => "icons/settings.svg", - Self::Refresh => "icons/refresh-cw.svg", - Self::Undo => "icons/undo-2.svg", - Self::Redo => "icons/redo-2.svg", - Self::ZoomIn => "icons/zoom-in.svg", - Self::ZoomOut => "icons/zoom-out.svg", - Self::Trash => "icons/trash.svg", - Self::Edit => "icons/pencil.svg", - Self::Save => "icons/save.svg", - Self::Download => "icons/download.svg", - Self::Share => "icons/share.svg", - Self::Send => "icons/send.svg", - Self::Print => "icons/printer.svg", - Self::EnterFullScreen => "icons/maximize.svg", - Self::ExitFullScreen => "icons/minimize.svg", - Self::Cut => "icons/scissors.svg", - Self::Paste => "icons/clipboard-paste.svg", - Self::Sort => "icons/arrow-up-down.svg", - Self::Home => "icons/house.svg", - Self::Menu => "icons/menu.svg", - Self::More => "icons/ellipsis.svg", - Self::Grid => "icons/layout-grid.svg", - Self::List => "icons/list.svg", - Self::File => "icons/file.svg", - Self::Image => "icons/image.svg", - Self::Calendar => "icons/calendar.svg", - Self::Clock => "icons/clock.svg", - Self::User => "icons/user.svg", - Self::Lock => "icons/lock.svg", - Self::Unlock => "icons/lock-open.svg", - Self::Star => "icons/star.svg", - Self::Heart => "icons/heart.svg", - Self::Pin => "icons/pin.svg", - Self::Mail => "icons/mail.svg", - Self::Link => "icons/link.svg", - Self::Play => "icons/play.svg", - Self::Pause => "icons/pause.svg", - Self::Help => "icons/circle-question-mark.svg", - Self::Volume => "icons/volume-2.svg", - Self::VolumeMuted => "icons/volume-x.svg", - Self::AlignLeft => "icons/text-align-start.svg", - Self::AlignCenter => "icons/text-align-center.svg", - Self::AlignRight => "icons/text-align-end.svg", - Self::Sun => "icons/sun.svg", - Self::Moon => "icons/moon.svg", - Self::CirclePlus => "icons/circle-plus.svg", - Self::Filter => "icons/filter.svg", - Self::GlobalOn => "icons/global-on.svg", - Self::GlobalOff => "icons/global-off.svg", - Self::GitFile => "icons/git-file.svg", - Self::GitCommit => "icons/git-commit.svg", - Self::GitIssueDone => "icons/git-issue-done.svg", - Self::GitIssueOpen => "icons/git-issue-open.svg", - Self::GitIssueClosed => "icons/git-issue-close.svg", - Self::GitIssueOngoing => "icons/git-issue-ongoing.svg", - Self::GitPullRequest => "icons/git-pull-request.svg", - Self::GitPullRequestClosed => "icons/git-pull-request-closed.svg", - Self::GitPullRequestDraft => "icons/git-pull-request-draft.svg", - Self::GitPullRequestMerged => "icons/git-pull-request-merged.svg", - Self::GitClone => "icons/git-clone.svg", - Self::GitBranch => "icons/git-branch.svg", - Self::Tag => "icons/tag.svg", - Self::Markdown => "icons/markdown.svg", - Self::Trending => "icons/trending.svg", - Self::Recent => "icons/recent.svg", - Self::Init => "icons/init.svg", - Self::EllipsisVertical => "icons/ellipsis-vertical.svg", - Self::ArrowUp => "icons/arrow-up.svg", - Self::Globe => "icons/globe.svg", - Self::Inbox => "icons/inbox.svg", - } - } - /// The stable identifier used for element and debug ids. pub fn slug(self) -> &'static str { match self { Self::Check => "check", Self::Close => "close", Self::ChevronDown => "chevron-down", - Self::ChevronLeft => "chevron-left", Self::ChevronRight => "chevron-right", - Self::ChevronUp => "chevron-up", Self::Plus => "plus", - Self::Minus => "minus", Self::Search => "search", Self::Folder => "folder", Self::Warning => "warning", - Self::Info => "info", Self::Copy => "copy", Self::Eye => "eye", Self::EyeOff => "eye-off", - Self::PanelLeft => "panel-left", - Self::PanelRight => "panel-right", Self::WindowMinimize => "window-minimize", Self::WindowMaximize => "window-maximize", Self::WindowRestore => "window-restore", @@ -317,57 +83,14 @@ impl IconRole { Self::Stop => "stop", Self::Settings => "settings", Self::Refresh => "refresh", - Self::Undo => "undo", - Self::Redo => "redo", - Self::ZoomIn => "zoom-in", - Self::ZoomOut => "zoom-out", - Self::Trash => "trash", - Self::Edit => "edit", - Self::Save => "save", - Self::Download => "download", - Self::Share => "share", - Self::Send => "send", - Self::Print => "print", - Self::EnterFullScreen => "enter-full-screen", - Self::ExitFullScreen => "exit-full-screen", - Self::Cut => "cut", - Self::Paste => "paste", - Self::Sort => "sort", - Self::Home => "home", - Self::Menu => "menu", Self::More => "more", Self::Grid => "grid", - Self::List => "list", Self::File => "file", - Self::Image => "image", - Self::Calendar => "calendar", Self::Clock => "clock", - Self::User => "user", - Self::Lock => "lock", Self::Unlock => "unlock", - Self::Star => "star", - Self::Heart => "heart", - Self::Pin => "pin", - Self::Mail => "mail", - Self::Link => "link", - Self::Play => "play", - Self::Pause => "pause", - Self::Help => "help", - Self::Volume => "volume", - Self::VolumeMuted => "volume-muted", - Self::AlignLeft => "align-left", - Self::AlignCenter => "align-center", - Self::AlignRight => "align-right", - Self::Sun => "sun", - Self::Moon => "moon", Self::CirclePlus => "circle-plus", - Self::Filter => "filter", - Self::GlobalOn => "global-on", - Self::GlobalOff => "global-off", - Self::GitFile => "git-file", Self::GitCommit => "git-commit", Self::GitIssueDone => "git-issue-done", - Self::GitIssueOpen => "git-issue-open", Self::GitIssueClosed => "git-issue-closed", Self::GitIssueOngoing => "git-issue-ongoing", Self::GitPullRequest => "git-pull-request", @@ -376,254 +99,30 @@ impl IconRole { Self::GitPullRequestMerged => "git-pull-request-merged", Self::GitClone => "git-clone", Self::GitBranch => "git-branch", - Self::Tag => "tag", Self::Markdown => "markdown", Self::Trending => "trending", - Self::Recent => "recent", - Self::Init => "init", Self::EllipsisVertical => "ellipsis-vertical", Self::ArrowUp => "arrow-up", - Self::Globe => "globe", Self::Inbox => "inbox", + Self::Stack => "stack", } } - /// Freedesktop names the role resolves through, best first. - /// - /// Symbolic names lead (Adwaita), with Breeze and legacy names as fallbacks. - fn freedesktop_names(self) -> &'static [&'static str] { - match self { - Self::Check => &[ - "object-select-symbolic", - "object-select", - "emblem-ok-symbolic", - "checkmark", - ], - Self::Close => &[ - "window-close-symbolic", - "window-close", - "close-symbolic", - "gtk-close", - ], - Self::ChevronDown => &[ - "pan-down-symbolic", - "pan-down", - "go-down-symbolic", - "arrow-down", - ], - Self::ChevronLeft => &[ - "pan-start-symbolic", - "pan-start", - "go-previous-symbolic", - "arrow-left", - ], - Self::ChevronRight => &[ - "pan-end-symbolic", - "pan-end", - "go-next-symbolic", - "arrow-right", - ], - Self::ChevronUp => &["pan-up-symbolic", "pan-up", "go-up-symbolic", "arrow-up"], - Self::Plus => &["list-add-symbolic", "list-add", "add"], - Self::Minus => &["list-remove-symbolic", "list-remove", "remove"], - Self::Search => &[ - "system-search-symbolic", - "system-search", - "search", - "edit-find", - ], - Self::Folder => &["folder-symbolic", "folder"], - Self::Warning => &["dialog-warning-symbolic", "dialog-warning", "warning"], - Self::Info => &["dialog-information-symbolic", "dialog-information", "info"], - Self::Copy => &["edit-copy-symbolic", "edit-copy"], - Self::Eye => &["view-visible-symbolic", "view-visible", "visibility", "eye"], - Self::EyeOff => &[ - "view-conceal-symbolic", - "view-hide-symbolic", - "view-hide", - "visibility-off", - "eye-off", - ], - Self::PanelLeft => &[ - "sidebar-expand-left", - "sidebar-show-symbolic", - "panel-left", - "sidebar-left", - ], - Self::PanelRight => &[ - "sidebar-expand-right", - "sidebar-show-right-symbolic", - "sidebar-show-symbolic", - "panel-right", - "sidebar-right", - ], - Self::WindowMinimize => &["window-minimize-symbolic", "window-minimize"], - Self::WindowMaximize => &["window-maximize-symbolic", "window-maximize"], - Self::WindowRestore => &["window-restore-symbolic", "window-restore"], - Self::Loader => &["process-working-symbolic", "process-working"], - Self::Microphone => &["audio-input-microphone-symbolic", "audio-input-microphone"], - Self::Stop => &["process-stop-symbolic", "process-stop"], - Self::Settings => &[ - "applications-system-symbolic", - "settings-symbolic", - "preferences-system-symbolic", - "system-run-symbolic", - ], - Self::Refresh => &["view-refresh-symbolic", "view-refresh"], - Self::Undo => &["edit-undo-symbolic", "edit-undo"], - Self::Redo => &["edit-redo-symbolic", "edit-redo"], - Self::ZoomIn => &["zoom-in-symbolic", "zoom-in"], - Self::ZoomOut => &["zoom-out-symbolic", "zoom-out"], - Self::Trash => &[ - "user-trash-symbolic", - "edit-delete-symbolic", - "user-trash", - "edit-delete", - ], - Self::Edit => &["document-edit-symbolic", "document-edit"], - Self::Save => &["document-save-symbolic", "document-save"], - Self::Download => &["folder-download-symbolic", "folder-download"], - Self::Share => &[ - "send-to-symbolic", - "emblem-shared-symbolic", - "emblem-shared", - ], - Self::Send => &["document-send-symbolic", "document-send"], - Self::Print => &[ - "printer-symbolic", - "document-print-symbolic", - "printer", - "document-print", - ], - Self::EnterFullScreen => &["view-fullscreen-symbolic", "view-fullscreen"], - Self::ExitFullScreen => &["view-restore-symbolic", "view-restore"], - Self::Cut => &["edit-cut-symbolic", "edit-cut"], - Self::Paste => &["edit-paste-symbolic", "edit-paste"], - Self::Sort => &[ - "view-sort-ascending-symbolic", - "view-sort-descending-symbolic", - "view-sort-ascending", - "view-sort-descending", - ], - Self::Home => &[ - "user-home-symbolic", - "go-home-symbolic", - "user-home", - "go-home", - ], - Self::Menu => &["open-menu-symbolic", "open-menu"], - Self::More => &[ - "view-more-horizontal-symbolic", - "view-more-symbolic", - "view-more-horizontal", - "view-more", - ], - Self::Grid => &["view-grid-symbolic", "view-app-grid-symbolic", "view-grid"], - Self::List => &[ - "view-list-symbolic", - "view-list-bullet-symbolic", - "view-list", - "view-list-bullet", - ], - Self::File => &[ - "text-x-generic-symbolic", - "text-x-generic", - "x-office-document-symbolic", - "x-office-document", - ], - Self::Image => &[ - "image-x-generic-symbolic", - "insert-image-symbolic", - "image-x-generic", - "insert-image", - ], - Self::Calendar => &["x-office-calendar-symbolic", "x-office-calendar"], - Self::Clock => &[ - "document-open-recent-symbolic", - "alarm-symbolic", - "clock-symbolic", - "document-open-recent", - ], - Self::User => &["avatar-default-symbolic", "avatar-default"], - Self::Lock => &[ - "changes-prevent-symbolic", - "changes-prevent", - "system-lock-screen-symbolic", - "system-lock-screen", - ], - Self::Unlock => &["changes-allow-symbolic", "changes-allow"], - Self::Star => &[ - "non-starred-symbolic", - "non-starred", - "starred-symbolic", - "starred", - ], - Self::Heart => &["emote-love-symbolic", "emote-love"], - Self::Pin => &["view-pin-symbolic", "view-pin"], - Self::Mail => &[ - "mail-unread-symbolic", - "mail-message-new-symbolic", - "mail-unread", - "mail-message-new", - ], - Self::Link => &["insert-link-symbolic", "insert-link"], - Self::Play => &["media-playback-start-symbolic", "media-playback-start"], - Self::Pause => &["media-playback-pause-symbolic", "media-playback-pause"], - Self::Help => &[ - "dialog-question-symbolic", - "system-help-symbolic", - "dialog-question", - "system-help", - ], - Self::Volume => &["audio-volume-high-symbolic", "audio-volume-high"], - Self::VolumeMuted => &["audio-volume-muted-symbolic", "audio-volume-muted"], - Self::AlignLeft => &["format-justify-left-symbolic", "format-justify-left"], - Self::AlignCenter => &["format-justify-center-symbolic", "format-justify-center"], - Self::AlignRight => &["format-justify-right-symbolic", "format-justify-right"], - Self::Sun => &[ - "weather-clear-symbolic", - "display-brightness-symbolic", - "weather-clear", - ], - Self::Moon => &["weather-clear-night-symbolic", "weather-clear-night"], - Self::CirclePlus - | Self::Filter - | Self::GlobalOn - | Self::GlobalOff - | Self::GitFile - | Self::GitCommit - | Self::GitIssueDone - | Self::GitIssueOpen - | Self::GitIssueClosed - | Self::GitIssueOngoing - | Self::GitPullRequest - | Self::GitPullRequestClosed - | Self::GitPullRequestDraft - | Self::GitPullRequestMerged - | Self::GitClone - | Self::GitBranch - | Self::Tag - | Self::Markdown - | Self::Trending - | Self::Recent - | Self::Init - | Self::EllipsisVertical - | Self::ArrowUp - | Self::Globe - | Self::Inbox => &[], - } + /// The bundled SVG asset path for the role. + fn asset_path(self) -> SharedString { + SharedString::from(format!("icons/{}.svg", self.slug())) } } /// A glyph named by an application's own icon set. pub trait IconNamed { - /// The SVG asset path, e.g. `icons/commit.svg`. + /// The SVG asset path, e.g. `icons/git-commit.svg`. fn path(self) -> SharedString; } impl IconNamed for IconRole { fn path(self) -> SharedString { - SharedString::from(self.asset_path()) + self.asset_path() } } @@ -710,59 +209,6 @@ impl Icon { self } - /// The asset key a resolved freedesktop file is served under. - #[cfg(target_os = "linux")] - fn freedesktop_asset_path(size: Pixels, role: &IconRole) -> Option { - let size = size.as_f32().max(1.0).round() as u32; - freedesktop::cached_asset_key(*role, size) - } - - /// Roles resolve per platform. - fn render_role( - size: Pixels, - color: Option, - transformation: Option, - rotation_period: Option, - role: IconRole, - ) -> AnyElement { - #[cfg(target_os = "windows")] - if let Some(glyph) = segoe::glyph(role) { - return Self::render_glyph(size, color, glyph).into_any_element(); - } - #[cfg(target_os = "linux")] - if let Some(path) = Self::freedesktop_asset_path(size, &role) { - return Self::render_svg_path(size, color, transformation, rotation_period, path) - .into_any_element(); - } - Self::render_svg_path( - size, - color, - transformation, - rotation_period, - SharedString::from(role.asset_path()), - ) - .into_any_element() - } - - /// Windows: the Segoe Fluent glyph drawn as text in the system font. - #[cfg(target_os = "windows")] - fn render_glyph(size: Pixels, color: Option, glyph: &'static str) -> AnyElement { - div() - .flex_none() - .size(size) - .flex() - .items_center() - .justify_center() - .child( - div() - .font_family(segoe::FONT_FAMILY) - .text_size(size) - .when_some(color, |el, color| el.text_color(color)) - .child(SharedString::new_static(glyph)), - ) - .into_any_element() - } - fn render_svg_path( size: Pixels, color: Option, @@ -820,42 +266,29 @@ impl RenderOnce for Icon { Glyph::Named(path) => { Self::render_svg_path(size, Some(color), transformation, rotation_period, path) } - Glyph::Role(role) => { - Self::render_role(size, Some(color), transformation, rotation_period, role) - } + Glyph::Role(role) => Self::render_svg_path( + size, + Some(color), + transformation, + rotation_period, + role.asset_path(), + ), } } } -/// The asset source serving the merged icon set. #[derive(rust_embed::RustEmbed)] #[folder = "src/icons/assets"] #[exclude = "*.DS_Store"] pub struct Assets; -fn asset_bytes(path: &str) -> Option> { - let name = path.strip_prefix("icons/")?; - Assets::get(name).map(|file| file.data) -} - -fn freedesktop_file(path: &str) -> Option>> { - let rest = path.strip_prefix("icons/freedesktop/")?; - let stem = rest.strip_suffix(".svg")?; - let (slug, size) = stem.rsplit_once('-')?; - let size = size.parse::().ok()?; - let role = IconRole::all().iter().find(|role| role.slug() == slug)?; - freedesktop::cached_file(*role, size).map(std::fs::read) -} - impl AssetSource for Assets { fn load(&self, path: &str) -> gpui::Result>> { - if let Some(file) = freedesktop_file(path) { - let bytes = file.map_err(|error| { - anyhow::anyhow!("failed to read freedesktop icon {path}: {error}") - })?; - return Ok(Some(std::borrow::Cow::Owned(bytes))); - } - Ok(asset_bytes(path)) + let name = match path.strip_prefix("icons/") { + Some(name) => name, + None => return Ok(None), + }; + Ok(Assets::get(name).map(|file| file.data)) } fn list(&self, path: &str) -> gpui::Result> { diff --git a/crates/ui/src/icons/segoe.rs b/crates/ui/src/icons/segoe.rs deleted file mode 100644 index eb1b2f3..0000000 --- a/crates/ui/src/icons/segoe.rs +++ /dev/null @@ -1,109 +0,0 @@ -//! Windows resolver: each role maps to a Segoe Fluent Icons codepoint, -//! rendered as text in the system font (never bundled). - -use crate::icons::IconRole; - -/// The Segoe Fluent Icons glyph for the role. -pub(crate) fn glyph(role: IconRole) -> Option<&'static str> { - let glyph = match role { - IconRole::Check => "\u{E73E}", // CheckMark - IconRole::Close => "\u{E8BB}", // ChromeClose - IconRole::ChevronDown => "\u{E70D}", // ChevronDown - IconRole::ChevronLeft => "\u{E76B}", // ChevronLeft - IconRole::ChevronRight => "\u{E76C}", // ChevronRight - IconRole::ChevronUp => "\u{E70E}", // ChevronUp - IconRole::Plus => "\u{E710}", // Add - IconRole::Minus => "\u{E738}", // Remove - IconRole::Search => "\u{E721}", // Search - IconRole::Folder => "\u{E8B7}", // Folder - IconRole::Warning => "\u{E7BA}", // Warning - IconRole::Info => "\u{E946}", // Info - IconRole::Copy => "\u{E8C8}", // Copy - IconRole::Eye => "\u{E7B3}", // RedEye - IconRole::EyeOff => "\u{ED1A}", // Hide - IconRole::PanelLeft => "\u{E90C}", // DockLeft - IconRole::PanelRight => "\u{E90D}", // DockRight - IconRole::WindowMinimize => "\u{E921}", // ChromeMinimize - IconRole::WindowMaximize => "\u{E922}", // ChromeMaximize - IconRole::WindowRestore => "\u{E923}", // ChromeRestore - IconRole::Microphone => "\u{E720}", // Microphone - IconRole::Stop => "\u{E71A}", // Stop - IconRole::Settings => "\u{E713}", // Settings - IconRole::Refresh => "\u{E72C}", // Refresh - IconRole::Undo => "\u{E7A7}", // Undo - IconRole::Redo => "\u{E7A6}", // Redo - IconRole::ZoomIn => "\u{E8A3}", // ZoomIn - IconRole::ZoomOut => "\u{E71F}", // ZoomOut - IconRole::Trash => "\u{E74D}", // Delete - IconRole::Edit => "\u{E70F}", // Edit - IconRole::Save => "\u{E74E}", // Save - IconRole::Download => "\u{E896}", // Download - IconRole::Share => "\u{E72D}", // Share - IconRole::Send => "\u{E724}", // Send - IconRole::Print => "\u{E749}", // Print - IconRole::EnterFullScreen => "\u{E740}", // FullScreen - IconRole::ExitFullScreen => "\u{E73F}", // BackToWindow - IconRole::Cut => "\u{E8C6}", // Cut - IconRole::Paste => "\u{E77F}", // Paste - IconRole::Sort => "\u{E8CB}", // Sort - IconRole::Home => "\u{E80F}", // Home - IconRole::Menu => "\u{E700}", // GlobalNavButton - IconRole::More => "\u{E712}", // More - IconRole::Grid => "\u{ECA5}", // Tiles - IconRole::List => "\u{EA37}", // List - IconRole::File => "\u{E8A5}", // Document - IconRole::Image => "\u{E8B9}", // Picture - IconRole::Calendar => "\u{E787}", // Calendar - IconRole::Clock => "\u{E917}", // Clock - IconRole::User => "\u{E77B}", // Contact - IconRole::Lock => "\u{E72E}", // Lock - IconRole::Unlock => "\u{E785}", // Unlock - IconRole::Star => "\u{E734}", // FavoriteStar - IconRole::Heart => "\u{EB51}", // Heart - IconRole::Pin => "\u{E718}", // Pin - IconRole::Mail => "\u{E715}", // Mail - IconRole::Link => "\u{E71B}", // Link - IconRole::Play => "\u{E768}", // Play - IconRole::Pause => "\u{E769}", // Pause - IconRole::Help => "\u{E897}", // Help - IconRole::Volume => "\u{E767}", // Volume - IconRole::VolumeMuted => "\u{E74F}", // Mute - IconRole::AlignLeft => "\u{E8E4}", // AlignLeft - IconRole::AlignCenter => "\u{E8E3}", // AlignCenter - IconRole::AlignRight => "\u{E8E2}", // AlignRight - IconRole::Sun => "\u{E706}", // Brightness - IconRole::Moon => "\u{E708}", // QuietHours - // No Segoe spinner glyph, the icon falls back to the bundled SVG. - IconRole::Loader => return None, - // App glyphs have no system equivalent, they always draw the bundled SVG. - IconRole::CirclePlus - | IconRole::Filter - | IconRole::GlobalOn - | IconRole::GlobalOff - | IconRole::GitFile - | IconRole::GitCommit - | IconRole::GitIssueDone - | IconRole::GitIssueOpen - | IconRole::GitIssueClosed - | IconRole::GitIssueOngoing - | IconRole::GitPullRequest - | IconRole::GitPullRequestClosed - | IconRole::GitPullRequestDraft - | IconRole::GitPullRequestMerged - | IconRole::GitClone - | IconRole::GitBranch - | IconRole::Tag - | IconRole::Markdown - | IconRole::Trending - | IconRole::Recent - | IconRole::Init - | IconRole::EllipsisVertical - | IconRole::ArrowUp - | IconRole::Globe - | IconRole::Inbox => return None, - }; - Some(glyph) -} - -/// The system font the codepoints resolve against (Windows 11+). -pub(crate) const FONT_FAMILY: &str = "Segoe Fluent Icons"; diff --git a/crates/ui/src/layout/panel.rs b/crates/ui/src/layout/panel.rs index 616e149..77b3533 100644 --- a/crates/ui/src/layout/panel.rs +++ b/crates/ui/src/layout/panel.rs @@ -7,7 +7,7 @@ use std::sync::Arc; use gpui::{ AnyElement, AnyView, App, Axis, Div, ElementId, Entity, IntoElement, ParentElement as _, - Render, RenderOnce, SharedString, StyleRefinement, Styled as _, Window, div, + Render, RenderOnce, SharedString, StyleRefinement, Styled as _, Window, div, px, }; use crate::layout::StyledExt as _; @@ -126,7 +126,7 @@ impl gpui::Styled for PanelRow { impl RenderOnce for PanelRow { fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement { let id = self.id.clone(); - let gutter = cx.theme().spacing.unit * 2.0; + let gutter = px(8.); let main = island( div() diff --git a/crates/ui/src/layout/resize_handle.rs b/crates/ui/src/layout/resize_handle.rs index 8160cb1..0481593 100644 --- a/crates/ui/src/layout/resize_handle.rs +++ b/crates/ui/src/layout/resize_handle.rs @@ -111,7 +111,7 @@ impl RenderOnce for ResizeHandle { fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement { let theme = cx.theme(); let ring = theme.colors.ring; - let thickness = theme.spacing.unit * 2.0; + let thickness = px(8.); let label = self .accessibility_label diff --git a/crates/ui/src/layout/titlebar.rs b/crates/ui/src/layout/titlebar.rs index e592939..dfa07f7 100644 --- a/crates/ui/src/layout/titlebar.rs +++ b/crates/ui/src/layout/titlebar.rs @@ -6,8 +6,8 @@ use gpui::prelude::FluentBuilder as _; use gpui::{ - AnyElement, App, ElementId, InteractiveElement as _, IntoElement, ParentElement, RenderOnce, - SharedString, StyleRefinement, Styled as _, Window, + AnyElement, App, ElementId, InteractiveElement as _, IntoElement, ParentElement as _, + RenderOnce, SharedString, StyleRefinement, Styled as _, Window, }; use crate::layout::window_controls::{WindowControls, titlebar_strip}; @@ -51,6 +51,15 @@ impl Titlebar { self } + /// Sets the element drawn before the tab bar, after the leading window controls. + pub fn prefix(mut self, prefix: E) -> Self + where + E: IntoElement, + { + self.prefix = vec![prefix.into_any_element()]; + self + } + /// Sets the element drawn after the tab bar, before the trailing window controls. pub fn suffix(mut self, suffix: E) -> Self where @@ -73,17 +82,11 @@ impl gpui::Styled for Titlebar { } } -impl ParentElement for Titlebar { - fn extend(&mut self, elements: impl IntoIterator) { - self.prefix.extend(elements); - } -} - impl RenderOnce for Titlebar { fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement { let theme = cx.theme(); let height = theme.titlebar_height; - let padding_x = theme.sizes.resolve(Size::default()).dense_padding_x; + let padding_x = theme.sizes.resolve(Size::default()).padding_x; let shadow_bleed = theme.elevations.control.bleed(); let id = self.id; diff --git a/crates/ui/src/theme/mod.rs b/crates/ui/src/theme/mod.rs index bcab744..90e36cc 100644 --- a/crates/ui/src/theme/mod.rs +++ b/crates/ui/src/theme/mod.rs @@ -76,7 +76,7 @@ pub const RESIZE_KEYBOARD_STEP: Pixels = px(32.0); /// The inset around a window's edge that starts a resize gesture. pub const WINDOW_RESIZE_INSET: Pixels = px(4.0); /// The pad macOS reserves for its traffic lights at a strip's leading edge. -pub const TRAFFIC_LIGHT_PAD: Pixels = px(78.0); +pub const TRAFFIC_LIGHT_PAD: Pixels = px(88.0); /// The width of a Windows caption button. pub const WINDOWS_CAPTION_WIDTH: Pixels = px(36.0); /// Windows paints its caption close-button hover red in every theme. @@ -190,7 +190,6 @@ pub struct Theme { pub material: MaterialTokens, pub ramps: Ramps, pub radius: Radius, - pub spacing: Spacing, pub elevations: Elevations, /// Overlay transition timing; gpui's animation primitives do the rest. pub motion: Motion, @@ -225,7 +224,6 @@ impl Theme { material: resolved.material, ramps: resolved.ramps, radius: resolved.radius, - spacing: resolved.spacing, elevations: resolved.elevations, motion: resolved.motion, scrollbar: resolved.scrollbar, @@ -292,12 +290,6 @@ impl Default for Radius { } } -/// The spacing rhythm: paddings and gaps step by this unit. -#[derive(Clone, Copy, Debug, PartialEq)] -pub struct Spacing { - pub unit: Pixels, -} - /// One layer of a floating panel's drop shadow. #[derive(Clone, Copy, Debug, PartialEq)] pub struct Shadow { diff --git a/crates/ui/src/theme/resolve.rs b/crates/ui/src/theme/resolve.rs index 8650c73..f16336c 100644 --- a/crates/ui/src/theme/resolve.rs +++ b/crates/ui/src/theme/resolve.rs @@ -5,7 +5,7 @@ use crate::theme::ramps::{AccentShades, Oklch, contrast_foreground, derive_shade use crate::theme::system::{SourceKind, SystemTheme}; use crate::theme::{ ColorTokens, CustomTheme, Elevations, MaterialTokens, Motion, Radius, Scrollbar, SizeTable, - Spacing, ThemeVariant, Typography, + ThemeVariant, Typography, }; /// Derived state shades for the colors that get pressed and hovered. @@ -28,7 +28,6 @@ pub struct ResolvedTheme { pub material: MaterialTokens, pub ramps: Ramps, pub radius: Radius, - pub spacing: Spacing, pub elevations: Elevations, pub motion: Motion, pub scrollbar: Scrollbar, @@ -213,9 +212,6 @@ pub(crate) fn resolve( colors, material, radius, - spacing: Spacing { - unit: root_font_size * 0.25, - }, elevations, motion: Motion::default(), scrollbar: Scrollbar { diff --git a/desktop/src/main.rs b/desktop/src/main.rs index e92bcc5..18b88f0 100644 --- a/desktop/src/main.rs +++ b/desktop/src/main.rs @@ -51,7 +51,10 @@ fn main() { titlebar: Some(TitlebarOptions { title: Some("Signed".into()), appears_transparent: true, - ..Default::default() + traffic_light_position: Some(point( + px(12.0), + (theme.titlebar_height - px(16.0)) / 2.0, + )), }), app_owns_titlebar_drag: true, window_background: theme.window_background,