desktop actions

This commit is contained in:
lebkuchen 2024-06-23 11:59:27 +02:00 committed by Jeremy Soller
parent 27bbd9bdb3
commit 9d53cfa9e5

View file

@ -1467,6 +1467,23 @@ impl cosmic::Application for CosmicAppList {
.on_press(Message::Exec(exec.to_string(), None)),
);
}
for action in desktop_info.actions().into_iter().flatten() {
if action == "new-window" {
continue;
}
let Some(exec) = desktop_info.action_entry(action, "Exec") else {
continue;
};
let Some(name) =
desktop_info.action_entry_localized(action, "Name", &self.locales)
else {
continue;
};
content = content.push(
menu_button(name.into()).on_press(Message::Exec(exec.into(), None)),
);
}
content = content.push(divider::horizontal::default());
}