Compare commits
2 commits
542657b557
...
9e0c2726ef
| Author | SHA1 | Date | |
|---|---|---|---|
| 9e0c2726ef | |||
| 30e562c8c2 |
2 changed files with 93 additions and 82 deletions
|
|
@ -2833,7 +2833,7 @@ impl Application for App {
|
||||||
fn nav_context_menu(
|
fn nav_context_menu(
|
||||||
&self,
|
&self,
|
||||||
) -> Option<Vec<widget::menu::Tree<cosmic::Action<Self::Message>>>> {
|
) -> Option<Vec<widget::menu::Tree<cosmic::Action<Self::Message>>>> {
|
||||||
let entity = self.nav_bar_context_id;
|
let items = self.nav_model.iter().map(|entity| {
|
||||||
let favorite_index_opt = self.nav_model.data::<FavoriteIndex>(entity);
|
let favorite_index_opt = self.nav_model.data::<FavoriteIndex>(entity);
|
||||||
let location_opt = self.nav_model.data::<Location>(entity);
|
let location_opt = self.nav_model.data::<Location>(entity);
|
||||||
|
|
||||||
|
|
@ -2919,8 +2919,13 @@ impl Application for App {
|
||||||
NavMenuAction::EmptyTrash,
|
NavMenuAction::EmptyTrash,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
items
|
||||||
|
});
|
||||||
|
|
||||||
Some(cosmic::widget::menu::items(&HashMap::new(), items))
|
Some(cosmic::widget::menu::nav_context(
|
||||||
|
&HashMap::new(),
|
||||||
|
items.collect(),
|
||||||
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn nav_model(&self) -> Option<&segmented_button::SingleSelectModel> {
|
fn nav_model(&self) -> Option<&segmented_button::SingleSelectModel> {
|
||||||
|
|
|
||||||
|
|
@ -418,6 +418,12 @@ pub fn context_menu<'a>(
|
||||||
if tab.mode.multiple() {
|
if tab.mode.multiple() {
|
||||||
children.push(menu_item(fl!("select-all"), Action::SelectAll).into());
|
children.push(menu_item(fl!("select-all"), Action::SelectAll).into());
|
||||||
}
|
}
|
||||||
|
if !Trash::is_empty() {
|
||||||
|
if !children.is_empty() {
|
||||||
|
children.push(divider::horizontal::light().into());
|
||||||
|
}
|
||||||
|
children.push(menu_item(fl!("empty-trash"), Action::EmptyTrash).into());
|
||||||
|
}
|
||||||
if !children.is_empty() {
|
if !children.is_empty() {
|
||||||
children.push(divider::horizontal::light().into());
|
children.push(divider::horizontal::light().into());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue