mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:17:35 +00:00
Taskbar: Use provided AppFile icon instead of finding it ourselves
This commit is contained in:
parent
8493477cc7
commit
c7e72a52a3
1 changed files with 3 additions and 2 deletions
|
@ -71,6 +71,7 @@ struct AppMetadata {
|
||||||
String executable;
|
String executable;
|
||||||
String name;
|
String name;
|
||||||
String category;
|
String category;
|
||||||
|
GUI::Icon icon;
|
||||||
bool run_in_terminal;
|
bool run_in_terminal;
|
||||||
};
|
};
|
||||||
Vector<AppMetadata> g_apps;
|
Vector<AppMetadata> g_apps;
|
||||||
|
@ -91,7 +92,7 @@ Vector<String> discover_apps_and_categories()
|
||||||
HashTable<String> seen_app_categories;
|
HashTable<String> seen_app_categories;
|
||||||
Desktop::AppFile::for_each([&](auto af) {
|
Desktop::AppFile::for_each([&](auto af) {
|
||||||
if (access(af->executable().characters(), X_OK) == 0) {
|
if (access(af->executable().characters(), X_OK) == 0) {
|
||||||
g_apps.append({ af->executable(), af->name(), af->category(), af->run_in_terminal() });
|
g_apps.append({ af->executable(), af->name(), af->category(), af->icon(), af->run_in_terminal() });
|
||||||
seen_app_categories.set(af->category());
|
seen_app_categories.set(af->category());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -172,7 +173,7 @@ NonnullRefPtr<GUI::Menu> build_system_menu()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto icon = GUI::FileIconProvider::icon_for_executable(app.executable).bitmap_for_size(16);
|
auto icon = app.icon.bitmap_for_size(16);
|
||||||
|
|
||||||
if constexpr (SYSTEM_MENU_DEBUG) {
|
if constexpr (SYSTEM_MENU_DEBUG) {
|
||||||
if (icon)
|
if (icon)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue