Restyle notification close control (#30262)

Follow-up of https://github.com/zed-industries/zed/pull/30015

Merges suppress and close buttons into one, with `shift` changing the
state and showing different tooltips.
Currently, there's no tooltip for notification suppress action, hence
none is displayed in the video:


https://github.com/user-attachments/assets/678c4d76-a86e-4fe9-8d7b-92996470a8a8

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2025-05-08 17:10:30 +03:00 committed by GitHub
parent 93b88a905a
commit 203cb7a7a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 123 additions and 77 deletions

View file

@ -5729,6 +5729,11 @@ impl Render for Workspace {
let theme = cx.theme().clone();
let colors = theme.colors();
let notification_entities = self
.notifications
.iter()
.map(|(_, notification)| notification.entity_id())
.collect::<Vec<_>>();
client_side_decorations(
self.actions(div(), window, cx)
@ -5744,6 +5749,11 @@ impl Render for Workspace {
.text_color(colors.text)
.overflow_hidden()
.children(self.titlebar_item.clone())
.on_modifiers_changed(move |_, _, cx| {
for &id in &notification_entities {
cx.notify(id);
}
})
.child(
div()
.size_full()