mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-29 12:38:02 +00:00
Use gpui instead of gpui2 consistenytly
This commit is contained in:
parent
eb325fb387
commit
496518f3e8
71 changed files with 111 additions and 111 deletions
|
@ -1,5 +1,5 @@
|
|||
use crate::{
|
||||
self as gpui2, hsla, point, px, relative, rems, AlignItems, CursorStyle, DefiniteLength,
|
||||
self as gpui, hsla, point, px, relative, rems, AlignItems, CursorStyle, DefiniteLength,
|
||||
Display, Fill, FlexDirection, Hsla, JustifyContent, Length, Position, Rems, SharedString,
|
||||
StyleRefinement, Visibility,
|
||||
};
|
||||
|
|
|
@ -28,9 +28,9 @@ pub fn derive_component(input: TokenStream) -> TokenStream {
|
|||
let (_, ty_generics, _) = ast.generics.split_for_impl();
|
||||
|
||||
let expanded = quote! {
|
||||
impl #impl_generics gpui2::Component<#view_type> for #name #ty_generics #where_clause {
|
||||
fn render(self) -> gpui2::AnyElement<#view_type> {
|
||||
(move |view_state: &mut #view_type, cx: &mut gpui2::ViewContext<'_, #view_type>| self.render(view_state, cx))
|
||||
impl #impl_generics gpui::Component<#view_type> for #name #ty_generics #where_clause {
|
||||
fn render(self) -> gpui::AnyElement<#view_type> {
|
||||
(move |view_state: &mut #view_type, cx: &mut gpui::ViewContext<'_, #view_type>| self.render(view_state, cx))
|
||||
.render()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ fn generate_predefined_setter(
|
|||
.iter()
|
||||
.map(|field_tokens| {
|
||||
quote! {
|
||||
style.#field_tokens = Some((#negation_token gpui2::#length_tokens).into());
|
||||
style.#field_tokens = Some((#negation_token gpui::#length_tokens).into());
|
||||
}
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
@ -163,7 +163,7 @@ fn generate_custom_value_setter(
|
|||
|
||||
let method = quote! {
|
||||
#[doc = #doc_string]
|
||||
fn #method_name(mut self, length: impl std::clone::Clone + Into<gpui2::#length_type>) -> Self where Self: std::marker::Sized {
|
||||
fn #method_name(mut self, length: impl std::clone::Clone + Into<gpui::#length_type>) -> Self where Self: std::marker::Sized {
|
||||
let style = self.style();
|
||||
#(#field_assignments)*
|
||||
self
|
||||
|
|
|
@ -16,14 +16,14 @@ name = "test_app"
|
|||
test-support = [
|
||||
"async-trait",
|
||||
"collections/test-support",
|
||||
"gpui2/test-support",
|
||||
"gpui/test-support",
|
||||
"live_kit_server",
|
||||
"nanoid",
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
collections = { path = "../collections", optional = true }
|
||||
gpui2 = { package = "gpui2", path = "../gpui2", optional = true }
|
||||
gpui = { package = "gpui2", path = "../gpui2", optional = true }
|
||||
live_kit_server = { path = "../live_kit_server", optional = true }
|
||||
media = { path = "../media" }
|
||||
|
||||
|
@ -41,7 +41,7 @@ nanoid = { version ="0.4", optional = true}
|
|||
|
||||
[dev-dependencies]
|
||||
collections = { path = "../collections", features = ["test-support"] }
|
||||
gpui2 = { package = "gpui2", path = "../gpui2", features = ["test-support"] }
|
||||
gpui = { package = "gpui2", path = "../gpui2", features = ["test-support"] }
|
||||
live_kit_server = { path = "../live_kit_server" }
|
||||
media = { path = "../media" }
|
||||
nanoid = "0.4"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::{sync::Arc, time::Duration};
|
||||
|
||||
use futures::StreamExt;
|
||||
use gpui2::KeyBinding;
|
||||
use gpui::KeyBinding;
|
||||
use live_kit_client2::{
|
||||
LocalAudioTrack, LocalVideoTrack, RemoteAudioTrackUpdate, RemoteVideoTrackUpdate, Room,
|
||||
};
|
||||
|
@ -16,7 +16,7 @@ struct Quit;
|
|||
fn main() {
|
||||
SimpleLogger::init(LevelFilter::Info, Default::default()).expect("could not initialize logger");
|
||||
|
||||
gpui2::App::production(Arc::new(())).run(|cx| {
|
||||
gpui::App::production(Arc::new(())).run(|cx| {
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
println!("USING TEST LIVEKIT");
|
||||
|
||||
|
@ -173,6 +173,6 @@ fn main() {
|
|||
});
|
||||
}
|
||||
|
||||
fn quit(_: &Quit, cx: &mut gpui2::AppContext) {
|
||||
fn quit(_: &Quit, cx: &mut gpui::AppContext) {
|
||||
cx.quit();
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ use anyhow::{anyhow, Context, Result};
|
|||
use async_trait::async_trait;
|
||||
use collections::{BTreeMap, HashMap};
|
||||
use futures::Stream;
|
||||
use gpui2::BackgroundExecutor;
|
||||
use gpui::BackgroundExecutor;
|
||||
use live_kit_server::token;
|
||||
use media::core_video::CVImageBuffer;
|
||||
use parking_lot::Mutex;
|
||||
|
|
|
@ -14,7 +14,7 @@ anyhow.workspace = true
|
|||
backtrace-on-stack-overflow = "0.3.0"
|
||||
clap = { version = "4.4", features = ["derive", "string"] }
|
||||
chrono = "0.4"
|
||||
gpui2 = { path = "../gpui2" }
|
||||
gpui = { package = "gpui2", path = "../gpui2" }
|
||||
itertools = "0.11.0"
|
||||
log.workspace = true
|
||||
rust-embed.workspace = true
|
||||
|
@ -29,4 +29,4 @@ ui = { package = "ui2", path = "../ui2", features = ["stories"] }
|
|||
util = { path = "../util" }
|
||||
|
||||
[dev-dependencies]
|
||||
gpui2 = { path = "../gpui2", features = ["test-support"] }
|
||||
gpui = { package = "gpui2", path = "../gpui2", features = ["test-support"] }
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::borrow::Cow;
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
use gpui2::{AssetSource, SharedString};
|
||||
use gpui::{AssetSource, SharedString};
|
||||
use rust_embed::RustEmbed;
|
||||
|
||||
#[derive(RustEmbed)]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use crate::story::Story;
|
||||
use gpui2::{px, Div, Render};
|
||||
use gpui::{px, Div, Render};
|
||||
use theme2::{default_color_scales, ColorScaleStep};
|
||||
use ui::prelude::*;
|
||||
|
||||
|
@ -20,7 +20,7 @@ impl Render for ColorsStory {
|
|||
.flex_col()
|
||||
.gap_1()
|
||||
.overflow_y_scroll()
|
||||
.text_color(gpui2::white())
|
||||
.text_color(gpui::white())
|
||||
.children(color_scales.into_iter().map(|scale| {
|
||||
div()
|
||||
.flex()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::{
|
||||
use gpui::{
|
||||
div, Div, FocusEnabled, Focusable, KeyBinding, ParentElement, Render, StatefulInteraction,
|
||||
StatelessInteractive, Styled, View, VisualContext, WindowContext,
|
||||
};
|
||||
|
@ -33,7 +33,7 @@ impl FocusStory {
|
|||
impl Render for FocusStory {
|
||||
type Element = Div<Self, StatefulInteraction<Self>, FocusEnabled<Self>>;
|
||||
|
||||
fn render(&mut self, cx: &mut gpui2::ViewContext<Self>) -> Self::Element {
|
||||
fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> Self::Element {
|
||||
let theme = cx.theme();
|
||||
let color_1 = theme.styles.git.created;
|
||||
let color_2 = theme.styles.git.modified;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use crate::{story::Story, story_selector::ComponentStory};
|
||||
use gpui2::{Div, Render, StatefulInteraction, View, VisualContext};
|
||||
use gpui::{Div, Render, StatefulInteraction, View, VisualContext};
|
||||
use strum::IntoEnumIterator;
|
||||
use ui::prelude::*;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::{
|
||||
use gpui::{
|
||||
div, px, Component, Div, ParentElement, Render, SharedString, StatefulInteraction, Styled,
|
||||
View, VisualContext, WindowContext,
|
||||
};
|
||||
|
@ -15,7 +15,7 @@ impl ScrollStory {
|
|||
impl Render for ScrollStory {
|
||||
type Element = Div<Self, StatefulInteraction<Self>>;
|
||||
|
||||
fn render(&mut self, cx: &mut gpui2::ViewContext<Self>) -> Self::Element {
|
||||
fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> Self::Element {
|
||||
let theme = cx.theme();
|
||||
let color_1 = theme.styles.git.created;
|
||||
let color_2 = theme.styles.git.modified;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::{div, white, Div, ParentElement, Render, Styled, View, VisualContext, WindowContext};
|
||||
use gpui::{div, white, Div, ParentElement, Render, Styled, View, VisualContext, WindowContext};
|
||||
|
||||
pub struct TextStory;
|
||||
|
||||
|
@ -11,7 +11,7 @@ impl TextStory {
|
|||
impl Render for TextStory {
|
||||
type Element = Div<Self>;
|
||||
|
||||
fn render(&mut self, cx: &mut gpui2::ViewContext<Self>) -> Self::Element {
|
||||
fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> Self::Element {
|
||||
div().size_full().bg(white()).child(concat!(
|
||||
"The quick brown fox jumps over the lazy dog. ",
|
||||
"Meanwhile, the lazy dog decided it was time for a change. ",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::{px, rgb, Div, Hsla, Render};
|
||||
use gpui::{px, rgb, Div, Hsla, Render};
|
||||
use ui::prelude::*;
|
||||
|
||||
use crate::story::Story;
|
||||
|
|
|
@ -5,7 +5,7 @@ use crate::stories::*;
|
|||
use anyhow::anyhow;
|
||||
use clap::builder::PossibleValue;
|
||||
use clap::ValueEnum;
|
||||
use gpui2::{AnyView, VisualContext};
|
||||
use gpui::{AnyView, VisualContext};
|
||||
use strum::{EnumIter, EnumString, IntoEnumIterator};
|
||||
use ui::prelude::*;
|
||||
use ui::{AvatarStory, ButtonStory, DetailsStory, IconStory, InputStory, LabelStory};
|
||||
|
|
|
@ -8,7 +8,7 @@ mod story_selector;
|
|||
use std::sync::Arc;
|
||||
|
||||
use clap::Parser;
|
||||
use gpui2::{
|
||||
use gpui::{
|
||||
div, px, size, AnyView, AppContext, Bounds, Div, Render, ViewContext, VisualContext,
|
||||
WindowBounds, WindowOptions,
|
||||
};
|
||||
|
@ -22,7 +22,7 @@ use ui::prelude::*;
|
|||
use crate::assets::Assets;
|
||||
use crate::story_selector::StorySelector;
|
||||
|
||||
// gpui2::actions! {
|
||||
// gpui::actions! {
|
||||
// storybook,
|
||||
// [ToggleInspector]
|
||||
// }
|
||||
|
@ -51,7 +51,7 @@ fn main() {
|
|||
let theme_name = args.theme.unwrap_or("Zed Pro Moonlight".to_string());
|
||||
|
||||
let asset_source = Arc::new(Assets);
|
||||
gpui2::App::production(asset_source).run(move |cx| {
|
||||
gpui::App::production(asset_source).run(move |cx| {
|
||||
load_embedded_fonts(cx).unwrap();
|
||||
|
||||
let mut store = SettingsStore::default();
|
||||
|
@ -116,7 +116,7 @@ impl Render for StoryWrapper {
|
|||
}
|
||||
}
|
||||
|
||||
fn load_embedded_fonts(cx: &AppContext) -> gpui2::Result<()> {
|
||||
fn load_embedded_fonts(cx: &AppContext) -> gpui::Result<()> {
|
||||
let font_paths = cx.asset_source().list("fonts")?;
|
||||
let mut embedded_fonts = Vec::new();
|
||||
for font_path in font_paths {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// todo!()
|
||||
use alacritty_terminal::term::color::Rgb as AlacRgb;
|
||||
// use gpui2::color::Color;
|
||||
// use gpui::color::Color;
|
||||
// use theme2::TerminalStyle;
|
||||
|
||||
///Converts a 2, 8, or 24 bit color ANSI color to the GPUI equivalent
|
||||
|
|
|
@ -7,7 +7,7 @@ publish = false
|
|||
[dependencies]
|
||||
anyhow.workspace = true
|
||||
chrono = "0.4"
|
||||
gpui2 = { path = "../gpui2" }
|
||||
gpui = { package = "gpui2", path = "../gpui2" }
|
||||
itertools = { version = "0.11.0", optional = true }
|
||||
serde.workspace = true
|
||||
settings2 = { path = "../settings2" }
|
||||
|
|
|
@ -40,12 +40,12 @@ impl<V: 'static> TodoList<V> {
|
|||
|
||||
All of this is relatively straightforward.
|
||||
|
||||
We use [gpui2::SharedString] in components instead of [std::string::String]. This allows us to [TODO: someone who actually knows please explain why we use SharedString].
|
||||
We use [gpui::SharedString] in components instead of [std::string::String]. This allows us to [TODO: someone who actually knows please explain why we use SharedString].
|
||||
|
||||
When we want to pass an action we pass a `ClickHandler`. Whenever we want to add an action, the struct it belongs to needs to be generic over the view type `V`.
|
||||
|
||||
~~~rust
|
||||
use gpui2::hsla
|
||||
use gpui::hsla
|
||||
|
||||
impl<V: 'static> TodoList<V> {
|
||||
// ...
|
||||
|
@ -74,7 +74,7 @@ As you start using the Tailwind-style conventions you will be surprised how quic
|
|||
|
||||
**Why `50.0/360.0` in `hsla()`?**
|
||||
|
||||
gpui [gpui2::Hsla] use `0.0-1.0` for all it's values, but it is common for tools to use `0-360` for hue.
|
||||
gpui [gpui::Hsla] use `0.0-1.0` for all it's values, but it is common for tools to use `0-360` for hue.
|
||||
|
||||
This may change in the future, but this is a little trick that let's you use familiar looking values.
|
||||
|
||||
|
@ -98,7 +98,7 @@ impl<V: 'static> TodoList<V> {
|
|||
Now we have access to the complete set of colors defined in the theme.
|
||||
|
||||
~~~rust
|
||||
use gpui2::hsla
|
||||
use gpui::hsla
|
||||
|
||||
impl<V: 'static> TodoList<V> {
|
||||
// ...
|
||||
|
@ -113,7 +113,7 @@ impl<V: 'static> TodoList<V> {
|
|||
Let's finish up some basic styles for the container then move on to adding the other elements.
|
||||
|
||||
~~~rust
|
||||
use gpui2::hsla
|
||||
use gpui::hsla
|
||||
|
||||
impl<V: 'static> TodoList<V> {
|
||||
// ...
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::img;
|
||||
use gpui::img;
|
||||
|
||||
use crate::prelude::*;
|
||||
|
||||
|
@ -33,7 +33,7 @@ impl Avatar {
|
|||
img.uri(self.src.clone())
|
||||
.size_4()
|
||||
// todo!(Pull the avatar fallback background from the theme.)
|
||||
.bg(gpui2::red())
|
||||
.bg(gpui::red())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ pub use stories::*;
|
|||
mod stories {
|
||||
use super::*;
|
||||
use crate::Story;
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
pub struct AvatarStory;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use gpui2::{div, rems, DefiniteLength, Hsla, MouseButton, WindowContext};
|
||||
use gpui::{div, rems, DefiniteLength, Hsla, MouseButton, WindowContext};
|
||||
|
||||
use crate::{h_stack, Icon, IconColor, IconElement, Label, LabelColor, LineHeightStyle};
|
||||
use crate::{prelude::*, IconButton};
|
||||
|
@ -234,7 +234,7 @@ pub use stories::*;
|
|||
mod stories {
|
||||
use super::*;
|
||||
use crate::{h_stack, v_stack, LabelColor, Story};
|
||||
use gpui2::{rems, Div, Render};
|
||||
use gpui::{rems, Div, Render};
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
pub struct ButtonStory;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use gpui2::{
|
||||
use gpui::{
|
||||
div, Component, ElementId, ParentElement, StatefulInteractive, StatelessInteractive, Styled,
|
||||
ViewContext,
|
||||
};
|
||||
|
@ -175,7 +175,7 @@ pub use stories::*;
|
|||
mod stories {
|
||||
use super::*;
|
||||
use crate::{h_stack, Story};
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
pub struct CheckboxStory;
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ pub use stories::*;
|
|||
mod stories {
|
||||
use super::*;
|
||||
use crate::story::Story;
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
pub struct ContextMenuStory;
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ pub use stories::*;
|
|||
mod stories {
|
||||
use super::*;
|
||||
use crate::{Button, Story};
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
pub struct DetailsStory;
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ pub use stories::*;
|
|||
mod stories {
|
||||
use super::*;
|
||||
use crate::{static_players, Story};
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
pub struct FacepileStory;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::{rems, svg, Hsla};
|
||||
use gpui::{rems, svg, Hsla};
|
||||
use strum::EnumIter;
|
||||
|
||||
use crate::prelude::*;
|
||||
|
@ -204,7 +204,7 @@ pub use stories::*;
|
|||
|
||||
#[cfg(feature = "stories")]
|
||||
mod stories {
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::Story;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use gpui2::{rems, MouseButton};
|
||||
use gpui::{rems, MouseButton};
|
||||
|
||||
use crate::{h_stack, prelude::*};
|
||||
use crate::{ClickHandler, Icon, IconColor, IconElement};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::px;
|
||||
use gpui::px;
|
||||
|
||||
use crate::prelude::*;
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ pub use stories::*;
|
|||
mod stories {
|
||||
use super::*;
|
||||
use crate::Story;
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
pub struct InputStory;
|
||||
|
||||
|
|
|
@ -158,7 +158,7 @@ pub use stories::*;
|
|||
mod stories {
|
||||
use super::*;
|
||||
use crate::Story;
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
use itertools::Itertools;
|
||||
|
||||
pub struct KeybindingStory;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::{relative, rems, Hsla, WindowContext};
|
||||
use gpui::{relative, rems, Hsla, WindowContext};
|
||||
use smallvec::SmallVec;
|
||||
|
||||
use crate::prelude::*;
|
||||
|
@ -194,7 +194,7 @@ pub use stories::*;
|
|||
mod stories {
|
||||
use super::*;
|
||||
use crate::Story;
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
pub struct LabelStory;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::div;
|
||||
use gpui::div;
|
||||
|
||||
use crate::settings::user_settings;
|
||||
use crate::{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::AnyElement;
|
||||
use gpui::AnyElement;
|
||||
use smallvec::SmallVec;
|
||||
|
||||
use crate::{h_stack, prelude::*, v_stack, Button, Icon, IconButton, Label};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::rems;
|
||||
use gpui::rems;
|
||||
|
||||
use crate::prelude::*;
|
||||
use crate::{h_stack, Icon};
|
||||
|
|
|
@ -153,13 +153,13 @@ impl PaletteItem {
|
|||
}
|
||||
}
|
||||
|
||||
use gpui2::ElementId;
|
||||
use gpui::ElementId;
|
||||
#[cfg(feature = "stories")]
|
||||
pub use stories::*;
|
||||
|
||||
#[cfg(feature = "stories")]
|
||||
mod stories {
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
use crate::{ModifierKeys, Story};
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::{AbsoluteLength, AnyElement};
|
||||
use gpui::{AbsoluteLength, AnyElement};
|
||||
use smallvec::SmallVec;
|
||||
|
||||
use crate::prelude::*;
|
||||
|
@ -126,7 +126,7 @@ pub use stories::*;
|
|||
mod stories {
|
||||
use super::*;
|
||||
use crate::{Label, Story};
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
pub struct PanelStory;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::{Hsla, ViewContext};
|
||||
use gpui::{Hsla, ViewContext};
|
||||
|
||||
use crate::prelude::*;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::SharedString;
|
||||
use gpui::SharedString;
|
||||
|
||||
use crate::Icon;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::{div, Div};
|
||||
use gpui::{div, Div};
|
||||
|
||||
use crate::prelude::*;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::prelude::*;
|
||||
use crate::{Icon, IconColor, IconElement, Label, LabelColor};
|
||||
use gpui2::{red, Div, ElementId, Render, View, VisualContext};
|
||||
use gpui::{red, Div, ElementId, Render, View, VisualContext};
|
||||
|
||||
#[derive(Component, Clone)]
|
||||
pub struct Tab {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::AnyElement;
|
||||
use gpui::AnyElement;
|
||||
use smallvec::SmallVec;
|
||||
|
||||
use crate::prelude::*;
|
||||
|
@ -70,7 +70,7 @@ pub use stories::*;
|
|||
|
||||
#[cfg(feature = "stories")]
|
||||
mod stories {
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
use crate::{Label, Story};
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::{div, Component, ParentElement};
|
||||
use gpui::{div, Component, ParentElement};
|
||||
|
||||
use crate::{Icon, IconColor, IconElement, IconSize};
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::{div, px, Div, ParentElement, Render, SharedString, Styled, ViewContext};
|
||||
use gpui::{div, px, Div, ParentElement, Render, SharedString, Styled, ViewContext};
|
||||
use theme2::ActiveTheme;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
pub use gpui2::{
|
||||
pub use gpui::{
|
||||
div, Component, Element, ElementId, ParentElement, SharedString, StatefulInteractive,
|
||||
StatelessInteractive, Styled, ViewContext, WindowContext,
|
||||
};
|
||||
|
@ -7,7 +7,7 @@ pub use crate::elevation::*;
|
|||
pub use crate::ButtonVariant;
|
||||
pub use theme2::ActiveTheme;
|
||||
|
||||
use gpui2::Hsla;
|
||||
use gpui::Hsla;
|
||||
use strum::EnumIter;
|
||||
|
||||
#[derive(Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, EnumIter)]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::ops::Deref;
|
||||
|
||||
use gpui2::{rems, AbsoluteLength, AppContext, WindowContext};
|
||||
use gpui::{rems, AbsoluteLength, AppContext, WindowContext};
|
||||
|
||||
use crate::prelude::*;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ use std::str::FromStr;
|
|||
use std::sync::Arc;
|
||||
|
||||
use chrono::DateTime;
|
||||
use gpui2::{AppContext, ViewContext};
|
||||
use gpui::{AppContext, ViewContext};
|
||||
use rand::Rng;
|
||||
use theme2::ActiveTheme;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::Div;
|
||||
use gpui::Div;
|
||||
|
||||
use crate::prelude::*;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::prelude::*;
|
||||
use crate::{Icon, IconButton, Label, Panel, PanelSide};
|
||||
use gpui2::{rems, AbsoluteLength};
|
||||
use gpui::{rems, AbsoluteLength};
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct AssistantPanel {
|
||||
|
@ -77,7 +77,7 @@ pub use stories::*;
|
|||
mod stories {
|
||||
use super::*;
|
||||
use crate::Story;
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
pub struct AssistantPanelStory;
|
||||
|
||||
impl Render for AssistantPanelStory {
|
||||
|
|
|
@ -2,7 +2,7 @@ use std::path::PathBuf;
|
|||
|
||||
use crate::prelude::*;
|
||||
use crate::{h_stack, HighlightedText};
|
||||
use gpui2::Div;
|
||||
use gpui::Div;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Symbol(pub Vec<HighlightedText>);
|
||||
|
@ -73,7 +73,7 @@ pub use stories::*;
|
|||
mod stories {
|
||||
use super::*;
|
||||
use crate::Story;
|
||||
use gpui2::Render;
|
||||
use gpui::Render;
|
||||
use std::str::FromStr;
|
||||
|
||||
pub struct BreadcrumbStory;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::{Hsla, WindowContext};
|
||||
use gpui::{Hsla, WindowContext};
|
||||
|
||||
use crate::prelude::*;
|
||||
use crate::{h_stack, v_stack, Icon, IconElement};
|
||||
|
@ -235,7 +235,7 @@ mod stories {
|
|||
empty_buffer_example, hello_world_rust_buffer_example,
|
||||
hello_world_rust_buffer_with_status_example, Story,
|
||||
};
|
||||
use gpui2::{rems, Div, Render};
|
||||
use gpui::{rems, Div, Render};
|
||||
|
||||
pub struct BufferStory;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::{Div, Render, View, VisualContext};
|
||||
use gpui::{Div, Render, View, VisualContext};
|
||||
|
||||
use crate::prelude::*;
|
||||
use crate::{h_stack, Icon, IconButton, IconColor, Input};
|
||||
|
|
|
@ -108,7 +108,7 @@ pub use stories::*;
|
|||
#[cfg(feature = "stories")]
|
||||
mod stories {
|
||||
use chrono::DateTime;
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
use crate::{Panel, Story};
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ pub use stories::*;
|
|||
mod stories {
|
||||
use super::*;
|
||||
use crate::Story;
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
pub struct CollabPanelStory;
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ pub use stories::*;
|
|||
|
||||
#[cfg(feature = "stories")]
|
||||
mod stories {
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
use crate::Story;
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ pub use stories::*;
|
|||
|
||||
#[cfg(feature = "stories")]
|
||||
mod stories {
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
use crate::Story;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::path::PathBuf;
|
||||
|
||||
use gpui2::{Div, Render, View, VisualContext};
|
||||
use gpui::{Div, Render, View, VisualContext};
|
||||
|
||||
use crate::prelude::*;
|
||||
use crate::{
|
||||
|
|
|
@ -40,7 +40,7 @@ pub use stories::*;
|
|||
mod stories {
|
||||
use super::*;
|
||||
use crate::Story;
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
pub struct LanguageSelectorStory;
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ pub use stories::*;
|
|||
mod stories {
|
||||
use super::*;
|
||||
use crate::{hello_world_rust_buffer_example, Story};
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
pub struct MultiBufferStory;
|
||||
|
||||
|
|
|
@ -345,7 +345,7 @@ impl<V> Notification<V> {
|
|||
}
|
||||
|
||||
use chrono::NaiveDateTime;
|
||||
use gpui2::{px, Styled};
|
||||
use gpui::{px, Styled};
|
||||
#[cfg(feature = "stories")]
|
||||
pub use stories::*;
|
||||
|
||||
|
@ -353,7 +353,7 @@ pub use stories::*;
|
|||
mod stories {
|
||||
use super::*;
|
||||
use crate::{Panel, Story};
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
pub struct NotificationsPanelStory;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::{hsla, red, AnyElement, ElementId, ExternalPaths, Hsla, Length, Size, View};
|
||||
use gpui::{hsla, red, AnyElement, ElementId, ExternalPaths, Hsla, Length, Size, View};
|
||||
use smallvec::SmallVec;
|
||||
|
||||
use crate::prelude::*;
|
||||
|
|
|
@ -46,7 +46,7 @@ impl ProjectPanel {
|
|||
}
|
||||
}
|
||||
|
||||
use gpui2::ElementId;
|
||||
use gpui::ElementId;
|
||||
#[cfg(feature = "stories")]
|
||||
pub use stories::*;
|
||||
|
||||
|
@ -54,7 +54,7 @@ pub use stories::*;
|
|||
mod stories {
|
||||
use super::*;
|
||||
use crate::{Panel, Story};
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
pub struct ProjectPanelStory;
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ pub use stories::*;
|
|||
mod stories {
|
||||
use super::*;
|
||||
use crate::Story;
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
pub struct RecentProjectsStory;
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ impl TabBar {
|
|||
}
|
||||
}
|
||||
|
||||
use gpui2::ElementId;
|
||||
use gpui::ElementId;
|
||||
#[cfg(feature = "stories")]
|
||||
pub use stories::*;
|
||||
|
||||
|
@ -100,7 +100,7 @@ pub use stories::*;
|
|||
mod stories {
|
||||
use super::*;
|
||||
use crate::Story;
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
pub struct TabBarStory;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::{relative, rems, Size};
|
||||
use gpui::{relative, rems, Size};
|
||||
|
||||
use crate::prelude::*;
|
||||
use crate::{Icon, IconButton, Pane, Tab};
|
||||
|
@ -83,7 +83,7 @@ pub use stories::*;
|
|||
mod stories {
|
||||
use super::*;
|
||||
use crate::Story;
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
pub struct TerminalStory;
|
||||
|
||||
impl Render for TerminalStory {
|
||||
|
|
|
@ -39,7 +39,7 @@ pub use stories::*;
|
|||
|
||||
#[cfg(feature = "stories")]
|
||||
mod stories {
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
use crate::Story;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::sync::atomic::AtomicBool;
|
||||
use std::sync::Arc;
|
||||
|
||||
use gpui2::{Div, Render, View, VisualContext};
|
||||
use gpui::{Div, Render, View, VisualContext};
|
||||
|
||||
use crate::prelude::*;
|
||||
use crate::settings::user_settings;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui2::AnyElement;
|
||||
use gpui::AnyElement;
|
||||
use smallvec::SmallVec;
|
||||
|
||||
use crate::prelude::*;
|
||||
|
@ -73,7 +73,7 @@ mod stories {
|
|||
use std::path::PathBuf;
|
||||
use std::str::FromStr;
|
||||
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
use crate::{Breadcrumb, HighlightedText, Icon, IconButton, Story, Symbol};
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ pub use stories::*;
|
|||
|
||||
#[cfg(feature = "stories")]
|
||||
mod stories {
|
||||
use gpui2::{Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
|
||||
use crate::Story;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use chrono::DateTime;
|
||||
use gpui2::{px, relative, Div, Render, Size, View, VisualContext};
|
||||
use gpui::{px, relative, Div, Render, Size, View, VisualContext};
|
||||
use settings2::Settings;
|
||||
use theme2::ThemeSettings;
|
||||
|
||||
|
@ -373,7 +373,7 @@ pub use stories::*;
|
|||
#[cfg(feature = "stories")]
|
||||
mod stories {
|
||||
use super::*;
|
||||
use gpui2::VisualContext;
|
||||
use gpui::VisualContext;
|
||||
|
||||
pub struct WorkspaceStory {
|
||||
workspace: View<Workspace>,
|
||||
|
|
|
@ -2,7 +2,7 @@ use anyhow::{anyhow, Result};
|
|||
use async_trait::async_trait;
|
||||
use collections::HashMap;
|
||||
use futures::lock::Mutex;
|
||||
use gpui2::executor::Background;
|
||||
use gpui::executor::Background;
|
||||
use language2::{LanguageServerName, LspAdapter, LspAdapterDelegate};
|
||||
use lsp2::LanguageServerBinary;
|
||||
use plugin_runtime::{Plugin, PluginBinary, PluginBuilder, WasiFn};
|
||||
|
|
6
test.rs
6
test.rs
|
@ -410,7 +410,7 @@ mod components {
|
|||
themes::rose_pine,
|
||||
};
|
||||
use gpui::{platform::MouseButton, ViewContext};
|
||||
use gpui2_macros::Element;
|
||||
use gpui_macros::Element;
|
||||
use std::{marker::PhantomData, rc::Rc};
|
||||
struct ButtonHandlers<V, D> {
|
||||
click: Option<Rc<dyn Fn(&mut V, &D, &mut ViewContext<V>)>>,
|
||||
|
@ -535,7 +535,7 @@ mod element {
|
|||
platform::{MouseButton, MouseButtonEvent},
|
||||
EngineLayout, EventContext, RenderContext, ViewContext,
|
||||
};
|
||||
use gpui2_macros::tailwind_lengths;
|
||||
use gpui_macros::tailwind_lengths;
|
||||
use std::{
|
||||
any::{Any, TypeId},
|
||||
cell::Cell,
|
||||
|
@ -4572,7 +4572,7 @@ mod frame {
|
|||
};
|
||||
use anyhow::{anyhow, Result};
|
||||
use gpui::LayoutNodeId;
|
||||
use gpui2_macros::IntoElement;
|
||||
use gpui_macros::IntoElement;
|
||||
#[element_crate = "crate"]
|
||||
pub struct Frame<V: 'static> {
|
||||
style: OptionalStyle,
|
||||
|
|
Loading…
Reference in a new issue