fix: don't allow favoriting apps without an exec string
This commit is contained in:
parent
0629b18e00
commit
91b4f80a9f
1 changed files with 21 additions and 15 deletions
|
|
@ -878,15 +878,17 @@ impl cosmic::Application for CosmicAppList {
|
||||||
};
|
};
|
||||||
dock_item.id = self.item_ctr;
|
dock_item.id = self.item_ctr;
|
||||||
|
|
||||||
self.favorite_list
|
if dock_item.desktop_info.exec.is_some() {
|
||||||
.insert(index.min(self.favorite_list.len()), dock_item);
|
|
||||||
self.config.update_favorites(
|
|
||||||
self.favorite_list
|
self.favorite_list
|
||||||
.iter()
|
.insert(index.min(self.favorite_list.len()), dock_item);
|
||||||
.map(|dock_item| dock_item.desktop_info.id.clone())
|
self.config.update_favorites(
|
||||||
.collect(),
|
self.favorite_list
|
||||||
&Config::new(APP_ID, AppListConfig::VERSION).unwrap(),
|
.iter()
|
||||||
);
|
.map(|dock_item| dock_item.desktop_info.id.clone())
|
||||||
|
.collect(),
|
||||||
|
&Config::new(APP_ID, AppListConfig::VERSION).unwrap(),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return finish_dnd();
|
return finish_dnd();
|
||||||
}
|
}
|
||||||
|
|
@ -1361,13 +1363,17 @@ impl cosmic::Application for CosmicAppList {
|
||||||
content = content.push(list_col);
|
content = content.push(list_col);
|
||||||
content = content.push(divider::horizontal::default());
|
content = content.push(divider::horizontal::default());
|
||||||
}
|
}
|
||||||
content = content.push(if is_favorite {
|
if is_favorite {
|
||||||
menu_button(iced::widget::text(fl!("unfavorite")))
|
content = content.push(
|
||||||
.on_press(Message::UnFavorite(desktop_info.id.clone()))
|
menu_button(iced::widget::text(fl!("unfavorite")))
|
||||||
} else {
|
.on_press(Message::UnFavorite(desktop_info.id.clone())),
|
||||||
menu_button(iced::widget::text(fl!("favorite")))
|
)
|
||||||
.on_press(Message::Favorite(desktop_info.id.clone()))
|
} else if let Some(_) = desktop_info.exec.clone() {
|
||||||
});
|
content = content.push(
|
||||||
|
menu_button(iced::widget::text(fl!("favorite")))
|
||||||
|
.on_press(Message::Favorite(desktop_info.id.clone())),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
content = match toplevels.len() {
|
content = match toplevels.len() {
|
||||||
0 => content,
|
0 => content,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue