forked from reya/gpui-native-kit
add toast and alert overlays to the shell
This commit is contained in:
@@ -63,7 +63,7 @@ badge = []
|
||||
input = ["button"]
|
||||
clipboard = ["button"]
|
||||
popover = []
|
||||
scroll_area = []
|
||||
scroll_area = ["scrollbar"]
|
||||
scrollbar = ["scroll_area"]
|
||||
segmented = []
|
||||
separator = []
|
||||
|
||||
@@ -332,6 +332,7 @@ impl RenderOnce for AlertsView {
|
||||
div()
|
||||
.relative()
|
||||
.w_full()
|
||||
.debug_selector(|| "alert-entry".to_string())
|
||||
.child(entry.alert.clone())
|
||||
.with_animation(
|
||||
("alert-enter", id),
|
||||
|
||||
@@ -14,6 +14,7 @@ use crate::common::v_flex;
|
||||
pub type ChangeHandler = Rc<dyn Fn(bool, &mut Window, &mut App)>;
|
||||
type ContentFn = Box<dyn Fn(&mut Window, &mut App) -> AnyElement>;
|
||||
type ActionsFn = Box<dyn Fn(&mut Window, &mut App) -> Vec<AnyElement>>;
|
||||
|
||||
/// A centred panel over a dim scrim: the platform's modal.
|
||||
#[derive(IntoElement)]
|
||||
pub struct Dialog {
|
||||
|
||||
@@ -275,6 +275,7 @@ fn pill(entry: &ToastEntry, toasts: &Entity<Toasts>, cx: &App) -> gpui::Stateful
|
||||
|
||||
div()
|
||||
.id(("toast", id))
|
||||
.debug_selector(|| "toast-pill".to_string())
|
||||
.max_w(px(480.))
|
||||
.flex()
|
||||
.items_center()
|
||||
|
||||
Reference in New Issue
Block a user