Vendor the native UI kit as crates/ui
- crates/ui holds the theme, icons, components, data widgets, editor surfaces, layout, and utilities; cargo feature gates are gone. - One merged icon set of 154 SVGs where the app file wins every duplicate name, served by a single rust-embed Assets source. - IconRole grows the 25 app glyphs, so assets::CustomIconName and crates/assets are deleted. - ui::init owns the theme and key bindings that desktop used to bind in three calls. - docs/gpui-native-kit-gaps.md becomes docs/ui-gaps.md; the icon gap is closed.
This commit is contained in:
@@ -1,23 +1,22 @@
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use anyhow::Error;
|
||||
use assets::CustomIconName;
|
||||
use gpui::prelude::FluentBuilder as _;
|
||||
use gpui::{
|
||||
AnyElement, App, Context, Entity, InteractiveElement as _, IntoElement, ParentElement as _,
|
||||
SharedString, StatefulInteractiveElement as _, Styled as _, Window, div, px,
|
||||
};
|
||||
use gpui_native_kit::avatar::Avatar;
|
||||
use gpui_native_kit::clipboard::ClipboardButton;
|
||||
use gpui_native_kit::combobox::ComboboxState;
|
||||
use gpui_native_kit::common::{Sizable as _, h_flex, v_flex};
|
||||
use gpui_native_kit::icons::Icon;
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use metadata::ProfileDirectory;
|
||||
use nostr::prelude::{RelayUrl, ToBech32};
|
||||
use signed_core::Announcement;
|
||||
use signed_git::{DiffHunk, DiffLine, DiffLineKind, FileCommit, FileDiff, Repo};
|
||||
use signed_state::{Nip34Binding, RepoListStore, RepoStore};
|
||||
use ui::avatar::Avatar;
|
||||
use ui::clipboard::ClipboardButton;
|
||||
use ui::combobox::ComboboxState;
|
||||
use ui::common::{Sizable as _, h_flex, v_flex};
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use utils::relative_time_secs;
|
||||
|
||||
use super::RepoDetailView;
|
||||
@@ -117,7 +116,7 @@ pub(super) fn fork_row(
|
||||
.min_w_0()
|
||||
.typeset(TextRole::Body, cx)
|
||||
.text_color(cx.theme().colors.muted_foreground)
|
||||
.child(Icon::named(CustomIconName::GitBranch).small())
|
||||
.child(Icon::named(IconRole::GitBranch).small())
|
||||
.child(div().whitespace_nowrap().text_ellipsis().child(label));
|
||||
|
||||
Some(if clickable {
|
||||
@@ -230,15 +229,13 @@ pub(super) fn preview_spinner() -> AnyElement {
|
||||
.size_full()
|
||||
.items_center()
|
||||
.justify_center()
|
||||
.child(gpui_native_kit::spinner::Spinner::new(
|
||||
"repo-preview-spinner",
|
||||
))
|
||||
.child(ui::spinner::Spinner::new("repo-preview-spinner"))
|
||||
.into_any_element()
|
||||
}
|
||||
|
||||
/// The kit grammar for a path; only four languages are supported.
|
||||
pub(super) fn code_language(path: &str) -> gpui_native_kit::editor::highlight::Language {
|
||||
use gpui_native_kit::editor::highlight::Language;
|
||||
pub(super) fn code_language(path: &str) -> ui::editor::highlight::Language {
|
||||
use ui::editor::highlight::Language;
|
||||
match Path::new(path)
|
||||
.extension()
|
||||
.and_then(|ext| ext.to_str())
|
||||
|
||||
Reference in New Issue
Block a user