From: <sa...@us...> - 2006-07-17 13:37:19
|
Revision: 16508 Author: sadrul Date: 2006-07-17 06:37:08 -0700 (Mon, 17 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16508&view=rev Log Message: ----------- Use alt+, and alt+. to change the order of the window. Modified Paths: -------------- trunk/console/libgnt/gntmain.c Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-07-17 12:22:37 UTC (rev 16507) +++ trunk/console/libgnt/gntmain.c 2006-07-17 13:37:08 UTC (rev 16508) @@ -275,6 +275,34 @@ g_signal_connect(G_OBJECT(tree), "activate", G_CALLBACK(window_list_activate), NULL); } +static void +shift_window(GntWidget *widget, int dir) +{ + GList *all = g_list_first(focus_list); + GList *list = g_list_find(all, widget); + int length, pos; + if (!list) + return; + + length = g_list_length(all); + pos = g_list_position(all, list); + + pos += dir; + if (dir > 0) + pos++; + + if (pos < 0) + pos = length; + else if (pos > length) + pos = 0; + + all = g_list_insert(all, widget, pos); + all = g_list_delete_link(all, list); + if (focus_list == list) + focus_list = g_list_find(all, widget); + draw_taskbar(); +} + static gboolean io_invoke(GIOChannel *source, GIOCondition cond, gpointer null) { @@ -351,6 +379,15 @@ /* Resize window */ mode = GNT_KP_MODE_RESIZE; } + else if (strcmp(buffer + 1, ",") == 0 && focus_list) + { + /* Re-order the list of windows */ + shift_window(focus_list->data, -1); + } + else if (strcmp(buffer + 1, ".") == 0 && focus_list) + { + shift_window(focus_list->data, 1); + } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |