This reverts commit 6767e98e00
.
Somehow that PR automerged itself even with failed CI checks.
Release Notes:
- N/A
This commit is contained in:
parent
87cdb68cca
commit
b75964a636
20 changed files with 161 additions and 139 deletions
|
@ -1,9 +1,9 @@
|
|||
use gpui::{hsla, App, Styled};
|
||||
|
||||
use crate::prelude::*;
|
||||
use crate::Elevation;
|
||||
use crate::ElevationIndex;
|
||||
|
||||
fn elevated<E: Styled>(this: E, cx: &App, index: Elevation) -> E {
|
||||
fn elevated<E: Styled>(this: E, cx: &App, index: ElevationIndex) -> E {
|
||||
this.bg(cx.theme().colors().elevated_surface_background)
|
||||
.rounded_lg()
|
||||
.border_1()
|
||||
|
@ -11,7 +11,7 @@ fn elevated<E: Styled>(this: E, cx: &App, index: Elevation) -> E {
|
|||
.shadow(index.shadow(cx))
|
||||
}
|
||||
|
||||
fn elevated_borderless<E: Styled>(this: E, cx: &mut App, index: Elevation) -> E {
|
||||
fn elevated_borderless<E: Styled>(this: E, cx: &mut App, index: ElevationIndex) -> E {
|
||||
this.bg(cx.theme().colors().elevated_surface_background)
|
||||
.rounded_lg()
|
||||
.shadow(index.shadow(cx))
|
||||
|
@ -33,56 +33,56 @@ pub trait StyledExt: Styled + Sized {
|
|||
self.flex().flex_col()
|
||||
}
|
||||
|
||||
/// The [`Surface`](Elevation::Surface) elevation level, located above the app background, is the standard level for all elements
|
||||
/// The [`Surface`](ElevationIndex::Surface) elevation level, located above the app background, is the standard level for all elements
|
||||
///
|
||||
/// Sets `bg()`, `rounded_lg()`, `border()`, `border_color()`, `shadow()`
|
||||
///
|
||||
/// Example Elements: Title Bar, Panel, Tab Bar, Editor
|
||||
fn elevation_1(self, cx: &mut App) -> Self {
|
||||
elevated(self, cx, Elevation::Surface)
|
||||
elevated(self, cx, ElevationIndex::Surface)
|
||||
}
|
||||
|
||||
/// See [`elevation_1`](Self::elevation_1).
|
||||
///
|
||||
/// Renders a borderless version [`elevation_1`](Self::elevation_1).
|
||||
fn elevation_1_borderless(self, cx: &mut App) -> Self {
|
||||
elevated_borderless(self, cx, Elevation::Surface)
|
||||
elevated_borderless(self, cx, ElevationIndex::Surface)
|
||||
}
|
||||
|
||||
/// Non-Modal Elevated Surfaces appear above the [`Surface`](Elevation::Surface) layer and is used for things that should appear above most UI elements like an editor or panel, but not elements like popovers, context menus, modals, etc.
|
||||
/// Non-Modal Elevated Surfaces appear above the [`Surface`](ElevationIndex::Surface) layer and is used for things that should appear above most UI elements like an editor or panel, but not elements like popovers, context menus, modals, etc.
|
||||
///
|
||||
/// Sets `bg()`, `rounded_lg()`, `border()`, `border_color()`, `shadow()`
|
||||
///
|
||||
/// Examples: Notifications, Palettes, Detached/Floating Windows, Detached/Floating Panels
|
||||
fn elevation_2(self, cx: &App) -> Self {
|
||||
elevated(self, cx, Elevation::ElevatedSurface)
|
||||
elevated(self, cx, ElevationIndex::ElevatedSurface)
|
||||
}
|
||||
|
||||
/// See [`elevation_2`](Self::elevation_2).
|
||||
///
|
||||
/// Renders a borderless version [`elevation_2`](Self::elevation_2).
|
||||
fn elevation_2_borderless(self, cx: &mut App) -> Self {
|
||||
elevated_borderless(self, cx, Elevation::ElevatedSurface)
|
||||
elevated_borderless(self, cx, ElevationIndex::ElevatedSurface)
|
||||
}
|
||||
|
||||
/// Modal Surfaces are used for elements that should appear above all other UI elements and are located above the wash layer. This is the maximum elevation at which UI elements can be rendered in their default state.
|
||||
///
|
||||
/// Elements rendered at this layer should have an enforced behavior: Any interaction outside of the modal will either dismiss the modal or prompt an action (Save your progress, etc) then dismiss the modal.
|
||||
///
|
||||
/// If the element does not have this behavior, it should be rendered at the [`Elevated Surface`](Elevation::ElevatedSurface) layer.
|
||||
/// If the element does not have this behavior, it should be rendered at the [`Elevated Surface`](ElevationIndex::ElevatedSurface) layer.
|
||||
///
|
||||
/// Sets `bg()`, `rounded_lg()`, `border()`, `border_color()`, `shadow()`
|
||||
///
|
||||
/// Examples: Settings Modal, Channel Management, Wizards/Setup UI, Dialogs
|
||||
fn elevation_3(self, cx: &mut App) -> Self {
|
||||
elevated(self, cx, Elevation::ModalSurface)
|
||||
elevated(self, cx, ElevationIndex::ModalSurface)
|
||||
}
|
||||
|
||||
/// See [`elevation_3`](Self::elevation_3).
|
||||
///
|
||||
/// Renders a borderless version [`elevation_3`](Self::elevation_3).
|
||||
fn elevation_3_borderless(self, cx: &mut App) -> Self {
|
||||
elevated_borderless(self, cx, Elevation::ModalSurface)
|
||||
elevated_borderless(self, cx, ElevationIndex::ModalSurface)
|
||||
}
|
||||
|
||||
/// The theme's primary border color.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue