Keep notification popovers open when unread badges clear
This commit is contained in:
1 parent
8bc82a58a2
commit
d18f0fd8be
2 files changed
+97
-14
No files matched your search
@@ -78,24 +78,28 @@ impl FereseShell {
|
||||
);
|
||||
}
|
||||
|
||||
if kind == Menu::Notifications
|
||||
&& self
|
||||
if kind == Menu::Notifications {
|
||||
// Reading notifications clears the dot. Keep its space so the
|
||||
// resulting panel allocation does not dismiss the new popover.
|
||||
let unread = self
|
||||
.status
|
||||
.notifications
|
||||
.as_ref()
|
||||
.is_some_and(|n| n.count > 0 && !n.dnd)
|
||||
{
|
||||
content = content.push(container(self.render.text("")).width(4).height(4).class(
|
||||
theme::Container::custom(move |_| container::Style {
|
||||
background: Some(Background::Color(foreground)),
|
||||
border: Border {
|
||||
shape: BorderShape::Continuous,
|
||||
radius: self.render.radius(2.0).into(),
|
||||
.is_some_and(|n| n.count > 0 && !n.dnd);
|
||||
content = content.push(
|
||||
container(cosmic::widget::Space::new())
|
||||
.width(4)
|
||||
.height(4)
|
||||
.class(theme::Container::custom(move |_| container::Style {
|
||||
background: unread.then_some(Background::Color(foreground)),
|
||||
border: Border {
|
||||
shape: BorderShape::Continuous,
|
||||
radius: self.render.radius(2.0).into(),
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
}),
|
||||
));
|
||||
})),
|
||||
);
|
||||
}
|
||||
let content = bar_content(content, metrics.group_item_height);
|
||||
let recording_busy = kind == Menu::Recording && self.recorder.busy();
|
||||
|
||||
Reference in new issue
Block a user