fix(app-tray): overflow popup active list calculation
This commit is contained in:
parent
5587877e74
commit
ba20b1268d
1 changed files with 36 additions and 34 deletions
|
|
@ -2015,15 +2015,17 @@ impl cosmic::Application for CosmicAppList {
|
||||||
let focused_item = self.currently_active_toplevel();
|
let focused_item = self.currently_active_toplevel();
|
||||||
let dot_radius = theme.cosmic().radius_xs();
|
let dot_radius = theme.cosmic().radius_xs();
|
||||||
// show the overflow popup for active list
|
// show the overflow popup for active list
|
||||||
let active: Vec<_> =
|
let active: Vec<_> = self
|
||||||
self.active_list[..active_popup_cutoff.map_or(self.active_list.len(), |n| {
|
.active_list
|
||||||
if n < self.active_list.len() {
|
|
||||||
n.saturating_sub(1)
|
|
||||||
} else {
|
|
||||||
n - 1
|
|
||||||
}
|
|
||||||
})]
|
|
||||||
.iter()
|
.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| {
|
.map(|dock_item| {
|
||||||
self.core
|
self.core
|
||||||
.applet
|
.applet
|
||||||
|
|
@ -2048,7 +2050,7 @@ impl cosmic::Application for CosmicAppList {
|
||||||
.into_owned(),
|
.into_owned(),
|
||||||
self.popup.is_some(),
|
self.popup.is_some(),
|
||||||
Message::Surface,
|
Message::Surface,
|
||||||
None,
|
Some(id),
|
||||||
)
|
)
|
||||||
.into()
|
.into()
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue