gpui2: Notifications

This commit is contained in:
Conrad Irwin 2023-11-26 22:27:33 -07:00
parent 700168467e
commit 039c933d8e
11 changed files with 190 additions and 111 deletions

View file

@ -1,12 +1,13 @@
use gpui::{div, Div, EventEmitter, ParentElement, Render, SemanticVersion, ViewContext};
use gpui::{
div, DismissEvent, Div, EventEmitter, ParentElement, Render, SemanticVersion, ViewContext,
};
use menu::Cancel;
use workspace::notifications::NotificationEvent;
pub struct UpdateNotification {
_version: SemanticVersion,
}
impl EventEmitter<NotificationEvent> for UpdateNotification {}
impl EventEmitter<DismissEvent> for UpdateNotification {}
impl Render for UpdateNotification {
type Element = Div;
@ -82,6 +83,6 @@ impl UpdateNotification {
}
pub fn _dismiss(&mut self, _: &Cancel, cx: &mut ViewContext<Self>) {
cx.emit(NotificationEvent::Dismiss);
cx.emit(DismissEvent::Dismiss);
}
}