go to line2 (#3261)
- MODAL - center a div - MOAR CODE - Beautiful go to line modal Release Notes: - N/A
This commit is contained in:
commit
b90e34aeb2
24 changed files with 535 additions and 338 deletions
28
crates/ui2/src/components/elevated_surface.rs
Normal file
28
crates/ui2/src/components/elevated_surface.rs
Normal file
|
@ -0,0 +1,28 @@
|
|||
use gpui::Div;
|
||||
|
||||
use crate::{prelude::*, v_stack};
|
||||
|
||||
/// Create an elevated surface.
|
||||
///
|
||||
/// Must be used inside of a relative parent element
|
||||
pub fn elevated_surface<V: 'static>(level: ElevationIndex, cx: &mut ViewContext<V>) -> Div<V> {
|
||||
let colors = cx.theme().colors();
|
||||
|
||||
// let shadow = BoxShadow {
|
||||
// color: hsla(0., 0., 0., 0.1),
|
||||
// offset: point(px(0.), px(1.)),
|
||||
// blur_radius: px(3.),
|
||||
// spread_radius: px(0.),
|
||||
// };
|
||||
|
||||
v_stack()
|
||||
.rounded_lg()
|
||||
.bg(colors.elevated_surface_background)
|
||||
.border()
|
||||
.border_color(colors.border)
|
||||
.shadow(level.shadow())
|
||||
}
|
||||
|
||||
pub fn modal<V>(cx: &mut ViewContext<V>) -> Div<V> {
|
||||
elevated_surface(ElevationIndex::ModalSurfaces, cx)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue