chore: Bump Rust edition to 2024 (#27800)
Follow-up to https://github.com/zed-industries/zed/pull/27791 Release Notes: - N/A
This commit is contained in:
parent
d50905e000
commit
dc64ec9cc8
802 changed files with 3775 additions and 3662 deletions
|
@ -1,6 +1,6 @@
|
|||
use crate::prelude::*;
|
||||
|
||||
use gpui::{img, AnyElement, Hsla, ImageSource, Img, IntoElement, Styled};
|
||||
use gpui::{AnyElement, Hsla, ImageSource, Img, IntoElement, Styled, img};
|
||||
|
||||
/// An element that renders a user avatar with customizable appearance options.
|
||||
///
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
use component::{example_group_with_title, single_example, ComponentPreview};
|
||||
use component::{ComponentPreview, example_group_with_title, single_example};
|
||||
use gpui::{AnyElement, AnyView, DefiniteLength};
|
||||
use ui_macros::IntoComponent;
|
||||
|
||||
use crate::{
|
||||
prelude::*, Color, DynamicSpacing, ElevationIndex, IconPosition, KeyBinding,
|
||||
KeybindingPosition, TintColor,
|
||||
};
|
||||
use crate::{ButtonCommon, ButtonLike, ButtonSize, ButtonStyle, IconName, IconSize, Label};
|
||||
use crate::{
|
||||
Color, DynamicSpacing, ElevationIndex, IconPosition, KeyBinding, KeybindingPosition, TintColor,
|
||||
prelude::*,
|
||||
};
|
||||
|
||||
use super::button_icon::ButtonIcon;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use crate::{prelude::*, Icon, IconName, IconSize, IconWithIndicator, Indicator};
|
||||
use crate::{Icon, IconName, IconSize, IconWithIndicator, Indicator, prelude::*};
|
||||
use gpui::Hsla;
|
||||
|
||||
/// An icon that appears within a button.
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use gpui::{relative, CursorStyle, DefiniteLength, MouseButton, MouseDownEvent, MouseUpEvent};
|
||||
use gpui::{transparent_black, AnyElement, AnyView, ClickEvent, Hsla, Rems};
|
||||
use gpui::{AnyElement, AnyView, ClickEvent, Hsla, Rems, transparent_black};
|
||||
use gpui::{CursorStyle, DefiniteLength, MouseButton, MouseDownEvent, MouseUpEvent, relative};
|
||||
use smallvec::SmallVec;
|
||||
|
||||
use crate::{prelude::*, DynamicSpacing, ElevationIndex};
|
||||
use crate::{DynamicSpacing, ElevationIndex, prelude::*};
|
||||
|
||||
/// A trait for buttons that can be Selected. Enables setting the [`ButtonStyle`] of a button when it is selected.
|
||||
pub trait SelectableButton: Toggleable {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use gpui::{AnyView, DefiniteLength, Hsla};
|
||||
|
||||
use super::button_like::{ButtonCommon, ButtonLike, ButtonSize, ButtonStyle};
|
||||
use crate::{prelude::*, ElevationIndex, Indicator, SelectableButton, TintColor};
|
||||
use crate::{ElevationIndex, Indicator, SelectableButton, TintColor, prelude::*};
|
||||
use crate::{IconName, IconSize};
|
||||
|
||||
use super::button_icon::ButtonIcon;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use gpui::{
|
||||
div, hsla, point, px, AnyElement, App, BoxShadow, IntoElement, ParentElement, RenderOnce,
|
||||
Styled, Window,
|
||||
AnyElement, App, BoxShadow, IntoElement, ParentElement, RenderOnce, Styled, Window, div, hsla,
|
||||
point, px,
|
||||
};
|
||||
use theme::ActiveTheme;
|
||||
|
||||
use crate::{h_flex, ElevationIndex};
|
||||
use crate::{ElevationIndex, h_flex};
|
||||
|
||||
use super::ButtonLike;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use gpui::{AnyView, ClickEvent};
|
||||
|
||||
use crate::{prelude::*, ButtonLike, ButtonLikeRounding, ElevationIndex};
|
||||
use crate::{ButtonLike, ButtonLikeRounding, ElevationIndex, prelude::*};
|
||||
|
||||
/// The position of a [`ToggleButton`] within a group of buttons.
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use crate::prelude::*;
|
||||
use component::{example_group, single_example, ComponentPreview};
|
||||
use component::{ComponentPreview, example_group, single_example};
|
||||
use gpui::{AnyElement, IntoElement, ParentElement, StyleRefinement, Styled};
|
||||
use smallvec::SmallVec;
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use crate::{
|
||||
h_flex, prelude::*, utils::WithRemSize, v_flex, Icon, IconName, IconSize, KeyBinding, Label,
|
||||
List, ListItem, ListSeparator, ListSubHeader,
|
||||
Icon, IconName, IconSize, KeyBinding, Label, List, ListItem, ListSeparator, ListSubHeader,
|
||||
h_flex, prelude::*, utils::WithRemSize, v_flex,
|
||||
};
|
||||
use gpui::{
|
||||
px, Action, AnyElement, App, AppContext as _, DismissEvent, Entity, EventEmitter, FocusHandle,
|
||||
Focusable, IntoElement, Render, Subscription,
|
||||
Action, AnyElement, App, AppContext as _, DismissEvent, Entity, EventEmitter, FocusHandle,
|
||||
Focusable, IntoElement, Render, Subscription, px,
|
||||
};
|
||||
use menu::{SelectFirst, SelectLast, SelectNext, SelectPrevious};
|
||||
use settings::Settings;
|
||||
|
|
|
@ -2,7 +2,7 @@ use std::sync::Arc;
|
|||
|
||||
use gpui::{ClickEvent, CursorStyle};
|
||||
|
||||
use crate::{prelude::*, Color, IconButton, IconButtonShape, IconName, IconSize};
|
||||
use crate::{Color, IconButton, IconButtonShape, IconName, IconSize, prelude::*};
|
||||
|
||||
#[derive(IntoElement)]
|
||||
pub struct Disclosure {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use gpui::{ClickEvent, Corner, CursorStyle, Entity, MouseButton};
|
||||
|
||||
use crate::{prelude::*, ContextMenu, PopoverMenu};
|
||||
use crate::{ContextMenu, PopoverMenu, prelude::*};
|
||||
|
||||
#[derive(IntoElement)]
|
||||
pub struct DropdownMenu {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use crate::{prelude::*, Avatar};
|
||||
use crate::{Avatar, prelude::*};
|
||||
use gpui::{AnyElement, StyleRefinement};
|
||||
use smallvec::SmallVec;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui::{div, prelude::*, Div};
|
||||
use gpui::{Div, div, prelude::*};
|
||||
|
||||
/// Creates a horizontal group with tight, consistent spacing.
|
||||
///
|
||||
|
|
|
@ -5,11 +5,11 @@ use std::path::{Path, PathBuf};
|
|||
use std::sync::Arc;
|
||||
|
||||
pub use decorated_icon::*;
|
||||
use gpui::{img, svg, AnimationElement, AnyElement, Hsla, IntoElement, Rems, Transformation};
|
||||
use gpui::{AnimationElement, AnyElement, Hsla, IntoElement, Rems, Transformation, img, svg};
|
||||
pub use icon_decoration::*;
|
||||
pub use icons::*;
|
||||
|
||||
use crate::{prelude::*, Indicator};
|
||||
use crate::{Indicator, prelude::*};
|
||||
|
||||
#[derive(IntoElement)]
|
||||
pub enum AnyIcon {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use gpui::{AnyElement, IntoElement, Point};
|
||||
|
||||
use crate::{prelude::*, IconDecoration, IconDecorationKind};
|
||||
use crate::{IconDecoration, IconDecorationKind, prelude::*};
|
||||
|
||||
#[derive(IntoElement, IntoComponent)]
|
||||
pub struct DecoratedIcon {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui::{svg, Hsla, IntoElement, Point};
|
||||
use gpui::{Hsla, IntoElement, Point, svg};
|
||||
use strum::{EnumIter, EnumString, IntoStaticStr};
|
||||
use ui_macros::DerivePathStr;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use gpui::{svg, App, IntoElement, Rems, RenderOnce, Size, Styled, Window};
|
||||
use gpui::{App, IntoElement, Rems, RenderOnce, Size, Styled, Window, svg};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use strum::{EnumIter, EnumString, IntoStaticStr};
|
||||
use ui_macros::{path_str, DerivePathStr};
|
||||
use ui_macros::{DerivePathStr, path_str};
|
||||
|
||||
use crate::Color;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::{cmp::Ordering, ops::Range, rc::Rc};
|
||||
|
||||
use gpui::{
|
||||
fill, point, size, AnyElement, App, Bounds, Entity, Hsla, Point, UniformListDecoration,
|
||||
AnyElement, App, Bounds, Entity, Hsla, Point, UniformListDecoration, fill, point, size,
|
||||
};
|
||||
use smallvec::SmallVec;
|
||||
|
||||
|
@ -49,8 +49,13 @@ pub fn indent_guides<V: Render>(
|
|||
entity: Entity<V>,
|
||||
indent_size: Pixels,
|
||||
colors: IndentGuideColors,
|
||||
compute_indents_fn: impl Fn(&mut V, Range<usize>, &mut Window, &mut Context<V>) -> SmallVec<[usize; 64]>
|
||||
+ 'static,
|
||||
compute_indents_fn: impl Fn(
|
||||
&mut V,
|
||||
Range<usize>,
|
||||
&mut Window,
|
||||
&mut Context<V>,
|
||||
) -> SmallVec<[usize; 64]>
|
||||
+ 'static,
|
||||
) -> IndentGuides {
|
||||
let compute_indents_fn = Box::new(move |range, window: &mut Window, cx: &mut App| {
|
||||
entity.update(cx, |this, cx| compute_indents_fn(this, range, window, cx))
|
||||
|
@ -79,12 +84,12 @@ impl IndentGuides {
|
|||
mut self,
|
||||
entity: Entity<V>,
|
||||
render_fn: impl Fn(
|
||||
&mut V,
|
||||
RenderIndentGuideParams,
|
||||
&mut Window,
|
||||
&mut App,
|
||||
) -> SmallVec<[RenderedIndentGuide; 12]>
|
||||
+ 'static,
|
||||
&mut V,
|
||||
RenderIndentGuideParams,
|
||||
&mut Window,
|
||||
&mut App,
|
||||
) -> SmallVec<[RenderedIndentGuide; 12]>
|
||||
+ 'static,
|
||||
) -> Self {
|
||||
let render_fn = move |params, window: &mut Window, cx: &mut App| {
|
||||
entity.update(cx, |this, cx| render_fn(this, params, window, cx))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use crate::{prelude::*, AnyIcon};
|
||||
use crate::{AnyIcon, prelude::*};
|
||||
|
||||
#[derive(Default)]
|
||||
enum IndicatorKind {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use crate::PlatformStyle;
|
||||
use crate::{h_flex, prelude::*, Icon, IconName, IconSize};
|
||||
use crate::{Icon, IconName, IconSize, h_flex, prelude::*};
|
||||
use gpui::{
|
||||
relative, Action, AnyElement, App, FocusHandle, Global, IntoElement, Keystroke, Modifiers,
|
||||
Window,
|
||||
Action, AnyElement, App, FocusHandle, Global, IntoElement, Keystroke, Modifiers, Window,
|
||||
relative,
|
||||
};
|
||||
use itertools::Itertools;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::KeyBinding;
|
||||
use crate::{h_flex, prelude::*};
|
||||
use gpui::{point, AnyElement, App, BoxShadow, FontStyle, Hsla, IntoElement, Window};
|
||||
use gpui::{AnyElement, App, BoxShadow, FontStyle, Hsla, IntoElement, Window, point};
|
||||
use smallvec::smallvec;
|
||||
use theme::Appearance;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ use std::ops::Range;
|
|||
|
||||
use gpui::{FontWeight, HighlightStyle, StyledText};
|
||||
|
||||
use crate::{prelude::*, LabelCommon, LabelLike, LabelSize, LineHeightStyle};
|
||||
use crate::{LabelCommon, LabelLike, LabelSize, LineHeightStyle, prelude::*};
|
||||
|
||||
#[derive(IntoElement)]
|
||||
pub struct HighlightedLabel {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use crate::{prelude::*, LabelLike};
|
||||
use crate::{LabelLike, prelude::*};
|
||||
use gpui::StyleRefinement;
|
||||
|
||||
/// A struct representing a label element in the UI.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use gpui::AnyElement;
|
||||
use smallvec::SmallVec;
|
||||
|
||||
use crate::{prelude::*, v_flex, Label, ListHeader};
|
||||
use crate::{Label, ListHeader, prelude::*, v_flex};
|
||||
|
||||
pub enum EmptyMessage {
|
||||
Text(SharedString),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use crate::{h_flex, prelude::*, Disclosure, Label};
|
||||
use crate::{Disclosure, Label, h_flex, prelude::*};
|
||||
use gpui::{AnyElement, ClickEvent};
|
||||
use settings::Settings;
|
||||
use theme::ThemeSettings;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use gpui::{px, AnyElement, AnyView, ClickEvent, MouseButton, MouseDownEvent, Pixels};
|
||||
use gpui::{AnyElement, AnyView, ClickEvent, MouseButton, MouseDownEvent, Pixels, px};
|
||||
use smallvec::SmallVec;
|
||||
|
||||
use crate::{prelude::*, Disclosure};
|
||||
use crate::{Disclosure, prelude::*};
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, Default)]
|
||||
pub enum ListItemSpacing {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use crate::prelude::*;
|
||||
use crate::{h_flex, Icon, IconName, IconSize, Label};
|
||||
use crate::{Icon, IconName, IconSize, Label, h_flex};
|
||||
|
||||
#[derive(IntoElement)]
|
||||
pub struct ListSubHeader {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::{
|
||||
h_flex, v_flex, Clickable, Color, DynamicSpacing, Headline, HeadlineSize, IconButton,
|
||||
IconButtonShape, IconName, Label, LabelCommon, LabelSize,
|
||||
Clickable, Color, DynamicSpacing, Headline, HeadlineSize, IconButton, IconButtonShape,
|
||||
IconName, Label, LabelCommon, LabelSize, h_flex, v_flex,
|
||||
};
|
||||
use gpui::{prelude::FluentBuilder, *};
|
||||
use smallvec::SmallVec;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::prelude::*;
|
||||
use gpui::IntoElement;
|
||||
use smallvec::{smallvec, SmallVec};
|
||||
use smallvec::{SmallVec, smallvec};
|
||||
|
||||
#[derive(IntoElement, IntoComponent)]
|
||||
#[component(scope = "Notification")]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use gpui::ClickEvent;
|
||||
|
||||
use crate::{prelude::*, IconButtonShape};
|
||||
use crate::{IconButtonShape, prelude::*};
|
||||
|
||||
#[derive(IntoElement)]
|
||||
pub struct NumericStepper {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use crate::prelude::*;
|
||||
use crate::v_flex;
|
||||
use gpui::{
|
||||
div, AnyElement, App, Element, IntoElement, ParentElement, Pixels, RenderOnce, Styled, Window,
|
||||
AnyElement, App, Element, IntoElement, ParentElement, Pixels, RenderOnce, Styled, Window, div,
|
||||
};
|
||||
use smallvec::SmallVec;
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use std::{cell::RefCell, rc::Rc};
|
||||
|
||||
use gpui::{
|
||||
anchored, deferred, div, point, prelude::FluentBuilder, px, size, AnyElement, AnyView, App,
|
||||
Bounds, Corner, DismissEvent, DispatchPhase, Element, ElementId, Entity, Focusable as _,
|
||||
GlobalElementId, HitboxId, InteractiveElement, IntoElement, LayoutId, Length, ManagedView,
|
||||
MouseDownEvent, ParentElement, Pixels, Point, Style, Window,
|
||||
AnyElement, AnyView, App, Bounds, Corner, DismissEvent, DispatchPhase, Element, ElementId,
|
||||
Entity, Focusable as _, GlobalElementId, HitboxId, InteractiveElement, IntoElement, LayoutId,
|
||||
Length, ManagedView, MouseDownEvent, ParentElement, Pixels, Point, Style, Window, anchored,
|
||||
deferred, div, point, prelude::FluentBuilder, px, size,
|
||||
};
|
||||
|
||||
use crate::prelude::*;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use std::{cell::RefCell, rc::Rc};
|
||||
|
||||
use gpui::{
|
||||
anchored, deferred, div, px, AnyElement, App, Bounds, Corner, DismissEvent, DispatchPhase,
|
||||
Element, ElementId, Entity, Focusable as _, GlobalElementId, Hitbox, InteractiveElement,
|
||||
IntoElement, LayoutId, ManagedView, MouseButton, MouseDownEvent, ParentElement, Pixels, Point,
|
||||
Window,
|
||||
AnyElement, App, Bounds, Corner, DismissEvent, DispatchPhase, Element, ElementId, Entity,
|
||||
Focusable as _, GlobalElementId, Hitbox, InteractiveElement, IntoElement, LayoutId,
|
||||
ManagedView, MouseButton, MouseDownEvent, ParentElement, Pixels, Point, Window, anchored,
|
||||
deferred, div, px,
|
||||
};
|
||||
|
||||
pub struct RightClickMenu<M: ManagedView> {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
use std::{any::Any, cell::Cell, fmt::Debug, ops::Range, rc::Rc, sync::Arc};
|
||||
|
||||
use crate::{prelude::*, px, relative, IntoElement};
|
||||
use crate::{IntoElement, prelude::*, px, relative};
|
||||
use gpui::{
|
||||
point, quad, Along, App, Axis as ScrollbarAxis, BorderStyle, Bounds, ContentMask, Corners,
|
||||
Edges, Element, ElementId, Entity, EntityId, GlobalElementId, Hitbox, Hsla, LayoutId,
|
||||
ListState, MouseDownEvent, MouseMoveEvent, MouseUpEvent, Pixels, Point, ScrollHandle,
|
||||
ScrollWheelEvent, Size, Style, UniformListScrollHandle, Window,
|
||||
Along, App, Axis as ScrollbarAxis, BorderStyle, Bounds, ContentMask, Corners, Edges, Element,
|
||||
ElementId, Entity, EntityId, GlobalElementId, Hitbox, Hsla, LayoutId, ListState,
|
||||
MouseDownEvent, MouseMoveEvent, MouseUpEvent, Pixels, Point, ScrollHandle, ScrollWheelEvent,
|
||||
Size, Style, UniformListScrollHandle, Window, point, quad,
|
||||
};
|
||||
|
||||
pub struct Scrollbar {
|
||||
|
@ -171,11 +171,7 @@ impl ScrollbarState {
|
|||
let mut current_offset = self.scroll_handle.offset().along(axis).min(px(0.)).abs().0;
|
||||
if let Some(adjustment) = scroll_adjustment.and_then(|adjustment| {
|
||||
let adjust = adjustment.along(axis).0;
|
||||
if adjust < 0.0 {
|
||||
Some(adjust)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
if adjust < 0.0 { Some(adjust) } else { None }
|
||||
}) {
|
||||
current_offset -= adjustment;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use gpui::AnyElement;
|
||||
use smallvec::SmallVec;
|
||||
|
||||
use crate::{prelude::*, ListHeader};
|
||||
use crate::{ListHeader, prelude::*};
|
||||
|
||||
/// A group of settings.
|
||||
#[derive(IntoElement)]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui::{div, Div};
|
||||
use gpui::{Div, div};
|
||||
|
||||
use crate::StyledExt;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use gpui::{actions, Corner, Entity, Render};
|
||||
use gpui::{Corner, Entity, Render, actions};
|
||||
use story::Story;
|
||||
|
||||
use crate::prelude::*;
|
||||
use crate::{right_click_menu, ContextMenu, Label};
|
||||
use crate::{ContextMenu, Label, right_click_menu};
|
||||
|
||||
actions!(context_menu, [PrintCurrentDate, PrintBestFood]);
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use gpui::Render;
|
||||
use story::Story;
|
||||
|
||||
use crate::prelude::*;
|
||||
use crate::Disclosure;
|
||||
use crate::prelude::*;
|
||||
|
||||
pub struct DisclosureStory;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use gpui::Render;
|
||||
use story::{Story, StoryItem, StorySection};
|
||||
|
||||
use crate::{prelude::*, IconButtonShape, Tooltip};
|
||||
use crate::{IconButton, IconName};
|
||||
use crate::{IconButtonShape, Tooltip, prelude::*};
|
||||
|
||||
pub struct IconButtonStory;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ use gpui::Render;
|
|||
use itertools::Itertools;
|
||||
use story::Story;
|
||||
|
||||
use crate::{prelude::*, KeyBinding};
|
||||
use crate::{KeyBinding, prelude::*};
|
||||
|
||||
pub struct KeybindingStory;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use gpui::Render;
|
||||
use story::Story;
|
||||
|
||||
use crate::{prelude::*, ListHeader, ListSeparator, ListSubHeader};
|
||||
use crate::{List, ListItem};
|
||||
use crate::{ListHeader, ListSeparator, ListSubHeader, prelude::*};
|
||||
|
||||
pub struct ListStory;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use gpui::Render;
|
||||
use story::Story;
|
||||
|
||||
use crate::{prelude::*, IconButton};
|
||||
use crate::{IconButton, prelude::*};
|
||||
use crate::{IconName, ListHeader};
|
||||
|
||||
pub struct ListHeaderStory;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use gpui::Render;
|
||||
use story::Story;
|
||||
|
||||
use crate::{prelude::*, Avatar};
|
||||
use crate::{Avatar, prelude::*};
|
||||
use crate::{IconName, ListItem};
|
||||
|
||||
const OVERFLOWING_TEXT: &str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean mauris ligula, luctus vel dignissim eu, vestibulum sed libero. Sed at convallis velit.";
|
||||
|
|
|
@ -3,7 +3,7 @@ use std::cmp::Ordering;
|
|||
use gpui::Render;
|
||||
use story::Story;
|
||||
|
||||
use crate::{prelude::*, IconButtonShape, TabPosition};
|
||||
use crate::{IconButtonShape, TabPosition, prelude::*};
|
||||
use crate::{Indicator, Tab};
|
||||
|
||||
pub struct TabStory;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use gpui::Render;
|
||||
use story::Story;
|
||||
|
||||
use crate::{prelude::*, Tab, TabBar, TabPosition};
|
||||
use crate::{Tab, TabBar, TabPosition, prelude::*};
|
||||
|
||||
pub struct TabBarStory;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use gpui::Render;
|
||||
use story::{Story, StoryItem, StorySection};
|
||||
|
||||
use crate::{prelude::*, ToggleButton};
|
||||
use crate::{ToggleButton, prelude::*};
|
||||
|
||||
pub struct ToggleButtonStory;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use gpui::{AnyElement, ScrollHandle};
|
||||
use smallvec::SmallVec;
|
||||
|
||||
use crate::prelude::*;
|
||||
use crate::Tab;
|
||||
use crate::prelude::*;
|
||||
|
||||
#[derive(IntoElement)]
|
||||
pub struct TabBar {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use crate::{prelude::*, Indicator};
|
||||
use gpui::{div, AnyElement, FontWeight, IntoElement, Length};
|
||||
use crate::{Indicator, prelude::*};
|
||||
use gpui::{AnyElement, FontWeight, IntoElement, Length, div};
|
||||
|
||||
/// A table component
|
||||
#[derive(IntoElement, IntoComponent)]
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
use gpui::{
|
||||
div, hsla, prelude::*, AnyElement, AnyView, ElementId, Hsla, IntoElement, Styled, Window,
|
||||
AnyElement, AnyView, ElementId, Hsla, IntoElement, Styled, Window, div, hsla, prelude::*,
|
||||
};
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::utils::is_light;
|
||||
use crate::{prelude::*, ElevationIndex, KeyBinding};
|
||||
use crate::{Color, Icon, IconName, ToggleState};
|
||||
use crate::{ElevationIndex, KeyBinding, prelude::*};
|
||||
|
||||
// TODO: Checkbox, CheckboxWithLabel, and Switch could all be
|
||||
// restructured to use a ToggleLike, similar to Button/Buttonlike, Label/Labellike
|
||||
|
|
|
@ -3,7 +3,7 @@ use settings::Settings;
|
|||
use theme::ThemeSettings;
|
||||
|
||||
use crate::prelude::*;
|
||||
use crate::{h_flex, v_flex, Color, KeyBinding, Label, LabelSize, StyledExt};
|
||||
use crate::{Color, KeyBinding, Label, LabelSize, StyledExt, h_flex, v_flex};
|
||||
|
||||
#[derive(IntoComponent)]
|
||||
pub struct Tooltip {
|
||||
|
|
|
@ -2,32 +2,32 @@
|
|||
|
||||
pub use gpui::prelude::*;
|
||||
pub use gpui::{
|
||||
div, px, relative, rems, AbsoluteLength, AnyElement, App, Context, DefiniteLength, Div,
|
||||
Element, ElementId, InteractiveElement, ParentElement, Pixels, Rems, RenderOnce, SharedString,
|
||||
Styled, Window,
|
||||
AbsoluteLength, AnyElement, App, Context, DefiniteLength, Div, Element, ElementId,
|
||||
InteractiveElement, ParentElement, Pixels, Rems, RenderOnce, SharedString, Styled, Window, div,
|
||||
px, relative, rems,
|
||||
};
|
||||
|
||||
pub use component::{
|
||||
example_group, example_group_with_title, single_example, ComponentPreview, ComponentScope,
|
||||
ComponentPreview, ComponentScope, example_group, example_group_with_title, single_example,
|
||||
};
|
||||
pub use ui_macros::IntoComponent;
|
||||
|
||||
pub use crate::DynamicSpacing;
|
||||
pub use crate::animation::{AnimationDirection, AnimationDuration, DefaultAnimations};
|
||||
pub use crate::styles::{rems_from_px, vh, vw, PlatformStyle, StyledTypography, TextSize};
|
||||
pub use crate::styles::{PlatformStyle, StyledTypography, TextSize, rems_from_px, vh, vw};
|
||||
pub use crate::traits::clickable::*;
|
||||
pub use crate::traits::disableable::*;
|
||||
pub use crate::traits::fixed::*;
|
||||
pub use crate::traits::styled_ext::*;
|
||||
pub use crate::traits::toggleable::*;
|
||||
pub use crate::traits::visible_on_hover::*;
|
||||
pub use crate::DynamicSpacing;
|
||||
pub use crate::{h_container, h_flex, v_container, v_flex};
|
||||
pub use crate::{
|
||||
h_group, h_group_lg, h_group_sm, h_group_xl, v_group, v_group_lg, v_group_sm, v_group_xl,
|
||||
};
|
||||
pub use crate::{Button, ButtonSize, ButtonStyle, IconButton, SelectableButton};
|
||||
pub use crate::{ButtonCommon, Color};
|
||||
pub use crate::{Headline, HeadlineSize};
|
||||
pub use crate::{Icon, IconName, IconPosition, IconSize};
|
||||
pub use crate::{Label, LabelCommon, LabelSize, LineHeightStyle};
|
||||
pub use crate::{h_container, h_flex, v_container, v_flex};
|
||||
pub use crate::{
|
||||
h_group, h_group_lg, h_group_sm, h_group_xl, v_group, v_group_lg, v_group_sm, v_group_xl,
|
||||
};
|
||||
pub use theme::ActiveTheme;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use crate::{prelude::*, ContentGroup};
|
||||
use crate::{ContentGroup, prelude::*};
|
||||
use gpui::{AnimationElement, AnimationExt, Styled};
|
||||
use std::time::Duration;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::fmt::{self, Display, Formatter};
|
||||
|
||||
use gpui::{hsla, point, px, App, BoxShadow, Hsla};
|
||||
use smallvec::{smallvec, SmallVec};
|
||||
use gpui::{App, BoxShadow, Hsla, hsla, point, px};
|
||||
use smallvec::{SmallVec, smallvec};
|
||||
use theme::{ActiveTheme, Appearance};
|
||||
|
||||
/// Today, elevation is primarily used to add shadows to elements, and set the correct background for elements like buttons.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui::{px, rems, App, Pixels, Rems};
|
||||
use gpui::{App, Pixels, Rems, px, rems};
|
||||
use settings::Settings;
|
||||
use theme::{ThemeSettings, UiDensity};
|
||||
use ui_macros::derive_dynamic_spacing;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
use crate::prelude::*;
|
||||
use gpui::{
|
||||
div, rems, AnyElement, App, IntoElement, ParentElement, Rems, RenderOnce, SharedString, Styled,
|
||||
Window,
|
||||
AnyElement, App, IntoElement, ParentElement, Rems, RenderOnce, SharedString, Styled, Window,
|
||||
div, rems,
|
||||
};
|
||||
use settings::Settings;
|
||||
use theme::{ActiveTheme, ThemeSettings};
|
||||
|
||||
use crate::{rems_from_px, Color};
|
||||
use crate::{Color, rems_from_px};
|
||||
|
||||
/// Extends [`gpui::Styled`] with typography-related styling methods.
|
||||
pub trait StyledTypography: Styled + Sized {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui::{rems, Length, Rems, Window};
|
||||
use gpui::{Length, Rems, Window, rems};
|
||||
|
||||
/// The base size of a rem, in pixels.
|
||||
pub const BASE_REM_SIZE_IN_PX: f32 = 16.;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use strum::EnumString;
|
||||
use ui_macros::{path_str, DerivePathStr};
|
||||
use ui_macros::{DerivePathStr, path_str};
|
||||
|
||||
#[test]
|
||||
fn test_derive_path_str_with_prefix() {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use gpui::{hsla, App, Styled};
|
||||
use gpui::{App, Styled, hsla};
|
||||
|
||||
use crate::prelude::*;
|
||||
use crate::ElevationIndex;
|
||||
use crate::prelude::*;
|
||||
|
||||
fn elevated<E: Styled>(this: E, cx: &App, index: ElevationIndex) -> E {
|
||||
this.bg(cx.theme().colors().elevated_surface_background)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use gpui::{
|
||||
div, AnyElement, App, Bounds, Div, DivFrameState, Element, ElementId, GlobalElementId, Hitbox,
|
||||
AnyElement, App, Bounds, Div, DivFrameState, Element, ElementId, GlobalElementId, Hitbox,
|
||||
InteractiveElement as _, IntoElement, LayoutId, ParentElement, Pixels, StyleRefinement, Styled,
|
||||
Window,
|
||||
Window, div,
|
||||
};
|
||||
|
||||
/// An element that sets a particular rem size for its children.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue