From 9d53cfa9e597c493b31793d48e09ad5f4a7cc161 Mon Sep 17 00:00:00 2001 From: lebkuchen Date: Sun, 23 Jun 2024 11:59:27 +0200 Subject: [PATCH] desktop actions --- cosmic-app-list/src/app.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cosmic-app-list/src/app.rs b/cosmic-app-list/src/app.rs index 4e53b544..8a10f56a 100755 --- a/cosmic-app-list/src/app.rs +++ b/cosmic-app-list/src/app.rs @@ -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()); }