]> Dogcows Code - chaz/tint2/commitdiff
*add* option for ascending/descending/unsorted systray
authorAndreas Fink <andreas.fink85@googlemail.com>
Sun, 27 Sep 2009 19:52:25 +0000 (19:52 +0000)
committerAndreas Fink <andreas.fink85@googlemail.com>
Sun, 27 Sep 2009 19:52:25 +0000 (19:52 +0000)
src/config.c
src/systray/systraybar.c

index 2bfb34a28aee8c21cf5ee05f26472e12b98f2b92..10cf448e22ebc638ccf6d7c99a472705bed5ca0a 100644 (file)
@@ -575,8 +575,10 @@ void add_entry (char *key, char *value)
        else if (strcmp(key, "systray_sort") == 0) {
                if (strcmp(value, "desc") == 0)
                        systray.sort = -1;
-               else
+               else if (strcmp(value, "asc") == 0)
                        systray.sort = 1;
+               else
+                       systray.sort = 0;
        }
 
        /* Tooltip */
index 9f9c05d3bedbd8adcaaee7833b9e8396dbc7fb69..130372e329e33ec3e1f21f482ab1e76056bfa082 100644 (file)
@@ -319,8 +319,10 @@ gboolean add_icon(Window id)
        traywin = g_new0(TrayWindow, 1);
        traywin->id = id;
 
-       //      systray.list_icons = g_slist_prepend(systray.list_icons, traywin);
-       systray.list_icons = g_slist_insert_sorted(systray.list_icons, traywin, compare_traywindows);
+       if (systray.sort == 0)
+               systray.list_icons = g_slist_prepend(systray.list_icons, traywin);
+       else
+               systray.list_icons = g_slist_insert_sorted(systray.list_icons, traywin, compare_traywindows);
        systray.area.resize = 1;
        systray.area.redraw = 1;
        //printf("add_icon id %lx, %d\n", id, g_slist_length(systray.list_icons));
This page took 0.024798 seconds and 4 git commands to generate.