diff --git a/Cargo.lock b/Cargo.lock index 909c2410..4a11fe13 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -474,7 +474,7 @@ dependencies = [ "bitflags 2.6.0", "cexpr", "clang-sys", - "itertools 0.12.1", + "itertools 0.11.0", "log", "prettyplease", "proc-macro2", @@ -944,7 +944,7 @@ dependencies = [ [[package]] name = "collections" version = "0.1.0" -source = "git+https://github.com/huacnlee/zed.git?branch=export-platform-window#1dce79297865a43e65cb36ce6368c74088b9d62a" +source = "git+https://github.com/huacnlee/zed.git?branch=export-platform-window#4f7507eb244527afcab0c186b39eba047d11a158" dependencies = [ "rustc-hash", ] @@ -1275,7 +1275,7 @@ dependencies = [ [[package]] name = "derive_refineable" version = "0.1.0" -source = "git+https://github.com/huacnlee/zed.git?branch=export-platform-window#1dce79297865a43e65cb36ce6368c74088b9d62a" +source = "git+https://github.com/huacnlee/zed.git?branch=export-platform-window#4f7507eb244527afcab0c186b39eba047d11a158" dependencies = [ "proc-macro2", "quote", @@ -2203,7 +2203,7 @@ dependencies = [ [[package]] name = "gpui" version = "0.1.0" -source = "git+https://github.com/huacnlee/zed.git?branch=export-platform-window#1dce79297865a43e65cb36ce6368c74088b9d62a" +source = "git+https://github.com/huacnlee/zed.git?branch=export-platform-window#4f7507eb244527afcab0c186b39eba047d11a158" dependencies = [ "anyhow", "as-raw-xcb-connection", @@ -2302,7 +2302,7 @@ dependencies = [ [[package]] name = "gpui_macros" version = "0.1.0" -source = "git+https://github.com/huacnlee/zed.git?branch=export-platform-window#1dce79297865a43e65cb36ce6368c74088b9d62a" +source = "git+https://github.com/huacnlee/zed.git?branch=export-platform-window#4f7507eb244527afcab0c186b39eba047d11a158" dependencies = [ "proc-macro2", "quote", @@ -2497,7 +2497,7 @@ dependencies = [ [[package]] name = "http_client" version = "0.1.0" -source = "git+https://github.com/huacnlee/zed.git?branch=export-platform-window#1dce79297865a43e65cb36ce6368c74088b9d62a" +source = "git+https://github.com/huacnlee/zed.git?branch=export-platform-window#4f7507eb244527afcab0c186b39eba047d11a158" dependencies = [ "anyhow", "derive_more", @@ -3048,7 +3048,7 @@ dependencies = [ [[package]] name = "media" version = "0.1.0" -source = "git+https://github.com/huacnlee/zed.git?branch=export-platform-window#1dce79297865a43e65cb36ce6368c74088b9d62a" +source = "git+https://github.com/huacnlee/zed.git?branch=export-platform-window#4f7507eb244527afcab0c186b39eba047d11a158" dependencies = [ "anyhow", "bindgen", @@ -4149,7 +4149,7 @@ dependencies = [ [[package]] name = "refineable" version = "0.1.0" -source = "git+https://github.com/huacnlee/zed.git?branch=export-platform-window#1dce79297865a43e65cb36ce6368c74088b9d62a" +source = "git+https://github.com/huacnlee/zed.git?branch=export-platform-window#4f7507eb244527afcab0c186b39eba047d11a158" dependencies = [ "derive_refineable", ] @@ -4484,7 +4484,7 @@ checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" [[package]] name = "semantic_version" version = "0.1.0" -source = "git+https://github.com/huacnlee/zed.git?branch=export-platform-window#1dce79297865a43e65cb36ce6368c74088b9d62a" +source = "git+https://github.com/huacnlee/zed.git?branch=export-platform-window#4f7507eb244527afcab0c186b39eba047d11a158" dependencies = [ "anyhow", "serde", @@ -4848,7 +4848,6 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" name = "story" version = "0.1.0" dependencies = [ - "anyhow", "charts-rs", "chrono", "fake", @@ -4933,7 +4932,7 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "sum_tree" version = "0.1.0" -source = "git+https://github.com/huacnlee/zed.git?branch=export-platform-window#1dce79297865a43e65cb36ce6368c74088b9d62a" +source = "git+https://github.com/huacnlee/zed.git?branch=export-platform-window#4f7507eb244527afcab0c186b39eba047d11a158" dependencies = [ "arrayvec", "log", @@ -5552,7 +5551,7 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "util" version = "0.1.0" -source = "git+https://github.com/huacnlee/zed.git?branch=export-platform-window#1dce79297865a43e65cb36ce6368c74088b9d62a" +source = "git+https://github.com/huacnlee/zed.git?branch=export-platform-window#4f7507eb244527afcab0c186b39eba047d11a158" dependencies = [ "anyhow", "async-fs 1.6.0", diff --git a/crates/story/Cargo.toml b/crates/story/Cargo.toml index c74e06f2..9400193e 100644 --- a/crates/story/Cargo.toml +++ b/crates/story/Cargo.toml @@ -7,7 +7,6 @@ edition = "2021" ui.workspace = true gpui.workspace = true fake = "2.9.2" -anyhow = "1" charts-rs = "0.3" regex = "1" chrono = "0.4" diff --git a/crates/story/src/list_story.rs b/crates/story/src/list_story.rs index c5609f29..6a1ff4e6 100644 --- a/crates/story/src/list_story.rs +++ b/crates/story/src/list_story.rs @@ -12,7 +12,7 @@ use ui::{ label::Label, list::ListItem, list::{List, ListDelegate}, - theme::{hsl, ActiveTheme, Colorize as _}, + theme::{hsl, ActiveTheme}, v_flex, }; diff --git a/crates/ui/src/dock/tab_panel.rs b/crates/ui/src/dock/tab_panel.rs index e6897ff1..b8c57a69 100644 --- a/crates/ui/src/dock/tab_panel.rs +++ b/crates/ui/src/dock/tab_panel.rs @@ -15,7 +15,7 @@ use crate::{ tab::{Tab, TabBar}, theme::ActiveTheme, tooltip::Tooltip, - v_flex, AxisExt, IconName, Placement, Selectable, Sizable, StyledExt, + v_flex, AxisExt, IconName, Placement, Selectable, Sizable, }; use super::{ClosePanel, DockArea, Panel, PanelView, StackPanel, ToggleZoom}; diff --git a/crates/ui/src/dropdown.rs b/crates/ui/src/dropdown.rs index edb4d89b..d19c6415 100644 --- a/crates/ui/src/dropdown.rs +++ b/crates/ui/src/dropdown.rs @@ -11,7 +11,7 @@ use crate::{ h_flex, input::ClearButton, list::{self, List, ListDelegate, ListItem}, - theme::{ActiveTheme, Colorize}, + theme::ActiveTheme, v_flex, Disableable, Icon, IconName, Sizable, Size, StyleSized, StyledExt, }; diff --git a/crates/ui/src/link.rs b/crates/ui/src/link.rs index bc83500e..2e298a1e 100644 --- a/crates/ui/src/link.rs +++ b/crates/ui/src/link.rs @@ -3,7 +3,7 @@ use gpui::{ RenderOnce, SharedString, Stateful, StatefulInteractiveElement, Styled, }; -use crate::theme::{ActiveTheme as _, Colorize}; +use crate::theme::ActiveTheme as _; #[derive(IntoElement)] pub struct Link { diff --git a/crates/ui/src/modal.rs b/crates/ui/src/modal.rs index acc9a0f4..8943a7f0 100644 --- a/crates/ui/src/modal.rs +++ b/crates/ui/src/modal.rs @@ -187,7 +187,7 @@ impl RenderOnce for Modal { .with_easing(cubic_bezier(0.32, 0.72, 0., 1.)), move |this, delta| { let y_offset = px(0.) + delta * px(30.); - this.top(y + y_offset) + this.top(y + y_offset).opacity(delta) }, ), ), diff --git a/crates/ui/src/notification.rs b/crates/ui/src/notification.rs index 00b8a3b3..c983b85d 100644 --- a/crates/ui/src/notification.rs +++ b/crates/ui/src/notification.rs @@ -266,7 +266,7 @@ impl Render for Notification { this.left(px(0.) + x_offset).opacity(1. - delta) } else { let y_offset = px(-45.) + delta * px(45.); - this.top(px(0.) + y_offset) + this.top(px(0.) + y_offset).opacity(delta) } }, ) diff --git a/crates/ui/src/progress.rs b/crates/ui/src/progress.rs index 46df9c6b..160e571b 100644 --- a/crates/ui/src/progress.rs +++ b/crates/ui/src/progress.rs @@ -3,7 +3,7 @@ use gpui::{ WindowContext, }; -use crate::theme::{ActiveTheme, Colorize}; +use crate::theme::ActiveTheme; #[derive(IntoElement)] pub struct Progress { diff --git a/crates/ui/src/radio.rs b/crates/ui/src/radio.rs index 621825d8..61c8a13c 100644 --- a/crates/ui/src/radio.rs +++ b/crates/ui/src/radio.rs @@ -4,11 +4,7 @@ use gpui::{ WindowContext, }; -use crate::{ - h_flex, - theme::{ActiveTheme, Colorize}, - IconName, -}; +use crate::{h_flex, theme::ActiveTheme, IconName}; #[derive(IntoElement)] pub struct Radio { diff --git a/crates/ui/src/scroll/scrollbar.rs b/crates/ui/src/scroll/scrollbar.rs index 0a4771ab..679e1aaa 100644 --- a/crates/ui/src/scroll/scrollbar.rs +++ b/crates/ui/src/scroll/scrollbar.rs @@ -1,6 +1,6 @@ use std::{cell::Cell, rc::Rc}; -use crate::theme::{ActiveTheme, Colorize}; +use crate::theme::ActiveTheme; use gpui::{ fill, point, px, relative, size, Bounds, ContentMask, Edges, Element, EntityId, Hitbox, IntoElement, MouseDownEvent, MouseMoveEvent, MouseUpEvent, PaintQuad, Pixels, Point, Position, diff --git a/crates/ui/src/skeleton.rs b/crates/ui/src/skeleton.rs index f1eaea05..517ea5e7 100644 --- a/crates/ui/src/skeleton.rs +++ b/crates/ui/src/skeleton.rs @@ -5,7 +5,7 @@ use gpui::{ RenderOnce, Styled, }; -use crate::{theme::ActiveTheme, StyledExt}; +use crate::theme::ActiveTheme; #[derive(IntoElement)] pub struct Skeleton { diff --git a/crates/ui/src/slider.rs b/crates/ui/src/slider.rs index ec6c83fb..abc355b5 100644 --- a/crates/ui/src/slider.rs +++ b/crates/ui/src/slider.rs @@ -1,7 +1,4 @@ -use crate::{ - theme::{ActiveTheme, Colorize}, - tooltip::Tooltip, -}; +use crate::{theme::ActiveTheme, tooltip::Tooltip}; use gpui::{ canvas, div, px, relative, Axis, Bounds, DragMoveEvent, EntityId, EventEmitter, InteractiveElement, IntoElement, MouseButton, MouseDownEvent, ParentElement as _, Pixels, diff --git a/crates/ui/src/styled.rs b/crates/ui/src/styled.rs index 5b19f7fc..71395df5 100644 --- a/crates/ui/src/styled.rs +++ b/crates/ui/src/styled.rs @@ -2,11 +2,9 @@ use std::fmt::{self, Display, Formatter}; use crate::{ scroll::{Scrollable, ScrollbarAxis}, - theme::{ActiveTheme, Colorize}, -}; -use gpui::{ - div, px, Axis, Div, Element, EntityId, Fill, FocusHandle, Pixels, Styled, WindowContext, + theme::ActiveTheme, }; +use gpui::{div, px, Axis, Div, Element, EntityId, FocusHandle, Pixels, Styled, WindowContext}; /// Returns a `Div` as horizontal flex layout. pub fn h_flex() -> Div { @@ -122,45 +120,6 @@ pub trait StyledExt: Styled + Sized { font_weight!(font_extrabold, EXTRA_BOLD); font_weight!(font_black, BLACK); - /// Set the opacity of the element. - fn opacity(mut self, opacity: f32) -> Self { - let text_color = self.style().text.clone().and_then(|t| t.color); - let bg_color = self.style().background.clone(); - let border_color = self.style().border_color; - let box_shadow = self.style().box_shadow.clone(); - - let this = if let Some(bg) = bg_color { - match bg { - Fill::Color(color) => self.bg(color.opacity(opacity)), - } - } else { - self - }; - - let this = if let Some(color) = border_color { - this.border_color(color.opacity(opacity)) - } else { - this - }; - - let this = if let Some(mut shadow) = box_shadow { - for shadow in shadow.iter_mut() { - shadow.color = shadow.color.opacity(opacity); - } - this.shadow(shadow) - } else { - this - }; - - let this = if let Some(text_color) = text_color { - this.text_color(text_color.opacity(opacity)) - } else { - this - }; - - this - } - /// Set as Popover style fn popover_style(self, cx: &mut WindowContext) -> Self { self.bg(cx.theme().popover) diff --git a/crates/ui/src/switch.rs b/crates/ui/src/switch.rs index 9cd795f3..b3f74c82 100644 --- a/crates/ui/src/switch.rs +++ b/crates/ui/src/switch.rs @@ -1,10 +1,6 @@ use std::time::Duration; -use crate::{ - h_flex, - theme::{ActiveTheme, Colorize}, - Disableable, Sizable, Size, -}; +use crate::{h_flex, theme::ActiveTheme, Disableable, Sizable, Size}; use gpui::{ div, prelude::FluentBuilder as _, px, Animation, AnimationExt as _, Div, ElementId, InteractiveElement, IntoElement, ParentElement as _, RenderOnce, SharedString, Stateful, diff --git a/crates/ui/src/tab/tab.rs b/crates/ui/src/tab/tab.rs index 4a060ba2..03f1bf54 100644 --- a/crates/ui/src/tab/tab.rs +++ b/crates/ui/src/tab/tab.rs @@ -1,4 +1,4 @@ -use crate::theme::{ActiveTheme, Colorize}; +use crate::theme::ActiveTheme; use crate::Selectable; use gpui::prelude::FluentBuilder as _; use gpui::{ diff --git a/crates/ui/src/table.rs b/crates/ui/src/table.rs index c7c4f0f5..71f45798 100644 --- a/crates/ui/src/table.rs +++ b/crates/ui/src/table.rs @@ -3,7 +3,7 @@ use std::{cell::Cell, ops::Range, rc::Rc}; use crate::{ h_flex, scroll::{ScrollableAxis, ScrollableMask, Scrollbar, ScrollbarState}, - theme::{ActiveTheme, Colorize}, + theme::ActiveTheme, v_flex, Icon, IconName, }; use gpui::{ @@ -691,7 +691,8 @@ where view.delegate.load_more(cx); }) }) - }).detach() + }) + .detach() } } } diff --git a/crates/ui/src/time/calendar.rs b/crates/ui/src/time/calendar.rs index 0952a459..3e1fb44d 100644 --- a/crates/ui/src/time/calendar.rs +++ b/crates/ui/src/time/calendar.rs @@ -9,10 +9,7 @@ use gpui::{ use rust_i18n::t; use crate::{ - button::Button, - h_flex, - theme::{ActiveTheme, Colorize}, - v_flex, Disableable as _, IconName, Selectable, + button::Button, h_flex, theme::ActiveTheme, v_flex, Disableable as _, IconName, Selectable, }; use super::utils::days_in_month;