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,24 +1,23 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use assets::CustomIconName;
|
||||
use gpui::prelude::FluentBuilder as _;
|
||||
use gpui::{
|
||||
AnyElement, App, AppContext as _, Context, Entity, InteractiveElement as _, IntoElement,
|
||||
ParentElement as _, Render, SharedString, Styled as _, Subscription, UniformListScrollHandle,
|
||||
WeakEntity, Window, div, px, uniform_list,
|
||||
};
|
||||
use gpui_native_kit::button::Button;
|
||||
use gpui_native_kit::combobox::{Combobox, ComboboxState};
|
||||
use gpui_native_kit::common::{h_flex, v_flex};
|
||||
use gpui_native_kit::data::tabs::{Tab, Tabs};
|
||||
use gpui_native_kit::icons::{Icon, IconRole};
|
||||
use gpui_native_kit::input::{Input, InputState};
|
||||
use gpui_native_kit::layout::panel::Panel;
|
||||
use gpui_native_kit::menu::Menu;
|
||||
use gpui_native_kit::scrollbar::Scrollbar;
|
||||
use gpui_native_kit::spinner::Spinner;
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use signed_state::{CheckoutsStore, RepoStore};
|
||||
use ui::button::Button;
|
||||
use ui::combobox::{Combobox, ComboboxState};
|
||||
use ui::common::{h_flex, v_flex};
|
||||
use ui::data::tabs::{Tab, Tabs};
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::input::{Input, InputState};
|
||||
use ui::layout::panel::Panel;
|
||||
use ui::menu::Menu;
|
||||
use ui::scrollbar::Scrollbar;
|
||||
use ui::spinner::Spinner;
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
|
||||
use super::helpers::{ForkCompare, fork_display_name, truncate_label};
|
||||
use crate::repo::commit_diff::{CommitDiffView, DiffPane};
|
||||
@@ -307,7 +306,7 @@ impl NewPullRequestView {
|
||||
.trigger(move |_, _| {
|
||||
Button::new("compare-source")
|
||||
.label(source_label.clone())
|
||||
.variant(gpui_native_kit::button::ButtonVariant::Secondary)
|
||||
.variant(ui::button::ButtonVariant::Secondary)
|
||||
.into_any_element()
|
||||
})
|
||||
.items(move |_, _| {
|
||||
@@ -357,9 +356,9 @@ impl NewPullRequestView {
|
||||
.tabs(move |_, _| {
|
||||
vec![
|
||||
Tab::new("files", format!("Files ({files})"))
|
||||
.lead(Icon::named(CustomIconName::GitFile)),
|
||||
.lead(Icon::named(IconRole::GitFile)),
|
||||
Tab::new("commits", format!("Commits ({commits})"))
|
||||
.lead(Icon::named(CustomIconName::GitCommit)),
|
||||
.lead(Icon::named(IconRole::GitCommit)),
|
||||
]
|
||||
})
|
||||
.on_change(move |index, _, cx| {
|
||||
|
||||
Reference in New Issue
Block a user