+
+// Populates the list_icons list
+void launcher_load_icons(Launcher *launcher)
+{
+ // Load apps (.desktop style launcher items)
+ GSList* app = launcher->list_apps;
+ while (app != NULL) {
+ DesktopEntry entry;
+ launcher_read_desktop_file(app->data, &entry);
+ if (entry.exec) {
+ LauncherIcon *launcherIcon = calloc(1, sizeof(LauncherIcon));
+ launcherIcon->area.parent = launcher;
+ launcherIcon->area.panel = launcher->area.panel;
+ launcherIcon->area._draw_foreground = draw_launcher_icon;
+ launcherIcon->area.size_mode = SIZE_BY_CONTENT;
+ launcherIcon->area._resize = NULL;
+ launcherIcon->area.resize = 0;
+ launcherIcon->area.redraw = 1;
+ launcherIcon->area.bg = &g_array_index(backgrounds, Background, 0);
+ launcherIcon->area.on_screen = 1;
+ launcherIcon->area._on_change_layout = launcher_icon_on_change_layout;
+ if (launcher_tooltip_enabled)
+ launcherIcon->area._get_tooltip_text = launcher_icon_get_tooltip_text;
+ else
+ launcherIcon->area._get_tooltip_text = NULL;
+ launcherIcon->is_app_desktop = 1;
+ launcherIcon->cmd = strdup(entry.exec);
+ launcherIcon->icon_name = entry.icon ? strdup(entry.icon) : strdup(ICON_FALLBACK);
+ launcherIcon->icon_size = 1;
+ launcherIcon->icon_tooltip = entry.name ? strdup(entry.name) : strdup(entry.exec);
+ free_desktop_entry(&entry);
+ launcher->list_icons = g_slist_append(launcher->list_icons, launcherIcon);
+ add_area(&launcherIcon->area);
+ }
+ app = g_slist_next(app);
+ }
+}
+
+
+// Populates the list_themes list