add default icon on task (/usr/share/tint2/default_icon.png needed)

git-svn-id: http://tint2.googlecode.com/svn/trunk@184 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
lorthiois@bbsoft.fr
2009-09-19 05:30:43 +00:00
parent 1bb885f840
commit 5528aa49e9
4 changed files with 46 additions and 28 deletions

View File

@@ -58,6 +58,7 @@ int max_tick_urgent;
Panel *panel1 = 0;
int nb_panel;
Imlib_Image default_icon;
void init_panel()
@@ -65,6 +66,17 @@ void init_panel()
int i;
Panel *p;
// load default icon
char *path;
const gchar * const *data_dirs;
data_dirs = g_get_system_data_dirs ();
for (i = 0; data_dirs[i] != NULL; i++) {
path = g_build_filename(data_dirs[i], "tint2", "default_icon.png", NULL);
if (g_file_test (path, G_FILE_TEST_EXISTS))
default_icon = imlib_load_image(path);
g_free(path);
}
for (i=0 ; i < nb_panel ; i++) {
p = &panel1[i];
@@ -175,6 +187,11 @@ void cleanup_panel()
cleanup_systray();
cleanup_taskbar();
if (default_icon) {
imlib_context_set_image(default_icon);
imlib_free_image();
}
// font allocated once
if (panel1[0].g_task.font_desc) {
pango_font_description_free(panel1[0].g_task.font_desc);