fix(app-tray): overflow popup active list calculation

This commit is contained in:
Ashley Wulber 2025-11-12 13:02:36 -05:00 • committed by Michael Murphy
parent 5587877e74
commit ba20b1268d

View file

@ -2015,15 +2015,17 @@ impl cosmic::Application for CosmicAppList {
let focused_item = self.currently_active_toplevel();
let dot_radius = theme.cosmic().radius_xs();
// show the overflow popup for active list
let active: Vec<_> =
self.active_list[..active_popup_cutoff.map_or(self.active_list.len(), |n| {
if n < self.active_list.len() {
n.saturating_sub(1)
} else {
n - 1
}
})]
let active: Vec<_> = self
.active_list
.iter()
.rev()
.take(active_popup_cutoff.map_or(self.active_list.len(), |n| {
if n < self.active_list.len() {
self.active_list.len() - n + 1
} else {
0
}
}))
.map(|dock_item| {
self.core
.applet
@ -2048,7 +2050,7 @@ impl cosmic::Application for CosmicAppList {
.into_owned(),
self.popup.is_some(),
Message::Surface,
None,
Some(id),
)
.into()
})