Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions crates/workspace/src/notifications.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,9 +593,9 @@ pub mod simple_message_notification {

use gpui::{
AnyElement, DismissEvent, EventEmitter, FocusHandle, Focusable, ParentElement, Render,
SharedString, Styled,
ScrollHandle, SharedString, Styled,
};
use ui::prelude::*;
use ui::{WithScrollbar, prelude::*};

use crate::notifications::NotificationFrame;

Expand All @@ -617,6 +617,7 @@ pub mod simple_message_notification {
show_close_button: bool,
show_suppress_button: bool,
title: Option<SharedString>,
scroll_handle: ScrollHandle,
}

impl Focusable for MessageNotification {
Expand Down Expand Up @@ -661,6 +662,7 @@ pub mod simple_message_notification {
show_suppress_button: true,
title: None,
focus_handle: cx.focus_handle(),
scroll_handle: ScrollHandle::new(),
}
}

Expand Down Expand Up @@ -777,7 +779,18 @@ pub mod simple_message_notification {
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
NotificationFrame::new()
.with_title(self.title.clone())
.with_content((self.build_content)(window, cx))
.with_content(
div()
.child(
div()
.id("message-notification-content")
.max_h(vh(0.6, window))
.overflow_y_scroll()
.track_scroll(&self.scroll_handle.clone())
.child((self.build_content)(window, cx)),
)
.vertical_scrollbar_for(self.scroll_handle.clone(), window, cx),
)
.show_close_button(self.show_close_button)
.show_suppress_button(self.show_suppress_button)
.on_close(cx.listener(|_, suppress, _, cx| {
Expand Down
Loading