diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2020-07-27 02:49:40 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-28 16:29:44 +0200 |
commit | a9d30a59d97de7fd5c27f9b85d23541f71b3494f (patch) | |
tree | 53e23ed22654a7fb737cc9d0e623ba72b314a02d /Services | |
parent | 404981a89269e2ae2d6418aa19eaddeed9ce9ddd (diff) | |
download | serenity-a9d30a59d97de7fd5c27f9b85d23541f71b3494f.zip |
SystemMenu: Add icons for categories
Diffstat (limited to 'Services')
-rw-r--r-- | Services/SystemMenu/main.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Services/SystemMenu/main.cpp b/Services/SystemMenu/main.cpp index c7085bd7a8..0d0e6822fc 100644 --- a/Services/SystemMenu/main.cpp +++ b/Services/SystemMenu/main.cpp @@ -132,10 +132,16 @@ NonnullRefPtr<GUI::Menu> build_system_menu() // First we construct all the necessary app category submenus. HashMap<String, NonnullRefPtr<GUI::Menu>> app_category_menus; + auto category_icons = Core::ConfigFile::open("/res/icons/SystemMenu.ini"); for (const auto& category : sorted_app_categories) { if (app_category_menus.contains(category)) continue; auto& category_menu = system_menu->add_submenu(category); + auto category_icon_path = category_icons->read_entry("16x16", category); + if (!category_icon_path.is_empty()) { + auto icon = Gfx::Bitmap::load_from_file(category_icon_path); + category_menu.set_icon(icon); + } app_category_menus.set(category, category_menu); } |