From: <sa...@us...> - 2006-06-23 08:42:11
|
Revision: 16315 Author: sadrul Date: 2006-06-23 01:42:07 -0700 (Fri, 23 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16315&view=rev Log Message: ----------- A GntTree can take focus. Modified Paths: -------------- trunk/console/libgnt/gnttree.c Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2006-06-23 06:24:25 UTC (rev 16314) +++ trunk/console/libgnt/gnttree.c 2006-06-23 08:42:07 UTC (rev 16315) @@ -207,6 +207,7 @@ tree->hash = g_hash_table_new(g_direct_hash, g_direct_equal); GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_NO_SHADOW); + gnt_widget_set_take_focus(widget, TRUE); return widget; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-07-09 01:07:04
|
Revision: 16468 Author: sadrul Date: 2006-07-08 18:07:00 -0700 (Sat, 08 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16468&view=rev Log Message: ----------- This isn't necessary. Modified Paths: -------------- trunk/console/libgnt/gnttree.c Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2006-07-09 00:54:31 UTC (rev 16467) +++ trunk/console/libgnt/gnttree.c 2006-07-09 01:07:00 UTC (rev 16468) @@ -209,12 +209,6 @@ char *s = g_utf8_offset_to_pointer(str, widget->priv.width - 1 - pos); *s = '\0'; } - else - { - while (wr < widget->priv.width - 1 - pos) - str[wr++] = ' '; - str[wr] = 0; - } if (flags & GNT_TEXT_FLAG_BOLD) attr |= A_BOLD; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-19 13:45:01
|
Revision: 16883 Author: sadrul Date: 2006-08-19 06:44:47 -0700 (Sat, 19 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16883&view=rev Log Message: ----------- g_hash_table_remove_all is introduced in glib-2.12 Modified Paths: -------------- trunk/console/libgnt/gnttree.c Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2006-08-19 11:46:33 UTC (rev 16882) +++ trunk/console/libgnt/gnttree.c 2006-08-19 13:44:47 UTC (rev 16883) @@ -889,10 +889,16 @@ } } +static gboolean +return_true(gpointer key, gpointer data, gpointer null) +{ + return TRUE; +} + void gnt_tree_remove_all(GntTree *tree) { tree->root = NULL; - g_hash_table_remove_all(tree->hash); + g_hash_table_foreach_remove(tree->hash, (GHRFunc)return_true, NULL); g_list_free(tree->list); tree->list = NULL; tree->current = tree->top = tree->bottom = NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ebl...@us...> - 2006-08-20 02:24:19
|
Revision: 16896 Author: eblanton Date: 2006-08-19 19:24:15 -0700 (Sat, 19 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16896&view=rev Log Message: ----------- Bind ^n and ^p for gnttree navigation Modified Paths: -------------- trunk/console/libgnt/gnttree.c Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2006-08-20 02:13:05 UTC (rev 16895) +++ trunk/console/libgnt/gnttree.c 2006-08-20 02:24:15 UTC (rev 16896) @@ -2,6 +2,7 @@ #include "gntmarshal.h" #include <string.h> +#include <ctype.h> enum { @@ -468,10 +469,10 @@ GntTree *tree = GNT_TREE(widget); GntTreeRow *old = tree->current; GntTreeRow *row; + int dist; if (text[0] == 27) { - int dist; if (strcmp(text+1, GNT_KEY_DOWN) == 0 && (row = get_next(tree->current)) != NULL) { tree->current = row; @@ -490,9 +491,29 @@ redraw_tree(tree); } } - else if (text[0] == '\r') + else if (iscntrl(text[0])) { - gnt_widget_activate(widget); + if (strcmp(text, GNT_KEY_CTRL_N) == 0 && (row = get_next(tree->current)) != NULL) + { + tree->current = row; + if ((dist = get_distance(tree->current, tree->bottom)) < 0) + gnt_tree_scroll(tree, -dist); + else + redraw_tree(tree); + } + else if (strcmp(text, GNT_KEY_CTRL_P) == 0 && (row = get_prev(tree->current)) != NULL) + { + tree->current = row; + + if ((dist = get_distance(tree->current, tree->top)) > 0) + gnt_tree_scroll(tree, -dist); + else + redraw_tree(tree); + } + else if (text[0] == '\r') + { + gnt_widget_activate(widget); + } } else if (text[0] == ' ' && text[1] == 0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-25 19:04:38
|
Revision: 17032 Author: sadrul Date: 2006-08-25 12:04:29 -0700 (Fri, 25 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17032&view=rev Log Message: ----------- The entries in the accounts-window, the status-window etc. now should have the same order as in the xml-file. Modified Paths: -------------- trunk/console/libgnt/gnttree.c Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2006-08-25 18:21:22 UTC (rev 17031) +++ trunk/console/libgnt/gnttree.c 2006-08-25 19:04:29 UTC (rev 17032) @@ -990,7 +990,19 @@ GntTreeRow *r; r = g_hash_table_lookup(tree->hash, key); g_return_val_if_fail(!r || !r->choice, NULL); - + + if (bigbro == NULL) { + r = g_hash_table_lookup(tree->hash, parent); + if (!r) + r = tree->root; + else + r = r->child; + if (r) { + while (r->next) + r = r->next; + bigbro = r->key; + } + } row = gnt_tree_add_row_after(tree, key, row, parent, bigbro); row->choice = TRUE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-10-27 18:19:45
|
Revision: 17590 http://svn.sourceforge.net/gaim/?rev=17590&view=rev Author: sadrul Date: 2006-10-27 11:19:40 -0700 (Fri, 27 Oct 2006) Log Message: ----------- Fix the ctr-n and ctr-p binding in the tree-widget. Modified Paths: -------------- trunk/console/libgnt/gnttree.c Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2006-10-26 23:07:28 UTC (rev 17589) +++ trunk/console/libgnt/gnttree.c 2006-10-27 18:19:40 UTC (rev 17590) @@ -710,10 +710,10 @@ gnt_widget_class_register_action(parent_class, "move-up", action_up, "\033" GNT_KEY_UP, NULL); - gnt_widget_register_binding(parent_class, "move-up", "\033" GNT_KEY_CTRL_N, NULL); + gnt_widget_register_binding(parent_class, "move-up", GNT_KEY_CTRL_N, NULL); gnt_widget_class_register_action(parent_class, "move-down", action_down, "\033" GNT_KEY_DOWN, NULL); - gnt_widget_register_binding(parent_class, "move-down", "\033" GNT_KEY_CTRL_P, NULL); + gnt_widget_register_binding(parent_class, "move-down", GNT_KEY_CTRL_P, NULL); gnt_widget_class_register_action(parent_class, "page-up", action_page_up, "\033" GNT_KEY_PGUP, NULL); gnt_widget_class_register_action(parent_class, "page-down", action_page_down, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ebl...@us...> - 2006-10-31 03:11:50
|
Revision: 17635 http://svn.sourceforge.net/gaim/?rev=17635&view=rev Author: eblanton Date: 2006-10-30 19:11:33 -0800 (Mon, 30 Oct 2006) Log Message: ----------- Fix ^n and ^p to not be backwards Modified Paths: -------------- trunk/console/libgnt/gnttree.c Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2006-10-31 03:01:21 UTC (rev 17634) +++ trunk/console/libgnt/gnttree.c 2006-10-31 03:11:33 UTC (rev 17635) @@ -710,10 +710,10 @@ gnt_widget_class_register_action(parent_class, "move-up", action_up, "\033" GNT_KEY_UP, NULL); - gnt_widget_register_binding(parent_class, "move-up", GNT_KEY_CTRL_N, NULL); + gnt_widget_register_binding(parent_class, "move-up", GNT_KEY_CTRL_P, NULL); gnt_widget_class_register_action(parent_class, "move-down", action_down, "\033" GNT_KEY_DOWN, NULL); - gnt_widget_register_binding(parent_class, "move-down", GNT_KEY_CTRL_P, NULL); + gnt_widget_register_binding(parent_class, "move-down", GNT_KEY_CTRL_N, NULL); gnt_widget_class_register_action(parent_class, "page-up", action_page_up, "\033" GNT_KEY_PGUP, NULL); gnt_widget_class_register_action(parent_class, "page-down", action_page_down, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2007-03-30 06:48:35
|
Revision: 18221 http://svn.sourceforge.net/gaim/?rev=18221&view=rev Author: sadrul Date: 2007-03-29 23:48:32 -0700 (Thu, 29 Mar 2007) Log Message: ----------- Fine tune column hiding. Modified Paths: -------------- trunk/console/libgnt/gnttree.c Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2007-03-30 05:49:39 UTC (rev 18220) +++ trunk/console/libgnt/gnttree.c 2007-03-30 06:48:32 UTC (rev 18221) @@ -223,7 +223,11 @@ GList *iter; int i; gboolean notfirst = FALSE; + int lastvisible = tree->ncol; + while (lastvisible && tree->columns[lastvisible].invisible) + lastvisible--; + for (i = 0, iter = row->columns; i < tree->ncol && iter; i++, iter = iter->next) { GntTreeCol *col = iter->data; @@ -231,10 +235,16 @@ int len = gnt_util_onscreen_width(col->text, NULL); int fl = 0; gboolean cut = FALSE; + int width; if (tree->columns[i].invisible) continue; + if (i == lastvisible) + width = GNT_WIDGET(tree)->priv.width - gnt_util_onscreen_width(string->str, NULL); + else + width = tree->columns[i].width; + if (i == 0) { if (row->choice) @@ -269,8 +279,8 @@ notfirst = TRUE; - if (len > tree->columns[i].width) { - len = tree->columns[i].width - 1; + if (len > width) { + len = width - 1; cut = TRUE; } text = gnt_util_onscreen_width_to_pointer(col->text, len - fl, NULL); @@ -284,7 +294,7 @@ } if (len < tree->columns[i].width && iter->next) - g_string_append_printf(string, "%*s", tree->columns[i].width - len, ""); + g_string_append_printf(string, "%*s", width - len, ""); } return g_string_free(string, FALSE); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2007-04-01 03:53:12
|
Revision: 18223 http://svn.sourceforge.net/gaim/?rev=18223&view=rev Author: sadrul Date: 2007-03-31 20:53:01 -0700 (Sat, 31 Mar 2007) Log Message: ----------- Backspace to jump to parent. Modified Paths: -------------- trunk/console/libgnt/gnttree.c Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2007-03-30 08:29:51 UTC (rev 18222) +++ trunk/console/libgnt/gnttree.c 2007-04-01 03:53:01 UTC (rev 18223) @@ -567,6 +567,23 @@ } static gboolean +action_move_parent(GntBindable *bind, GList *null) +{ + GntTree *tree = GNT_TREE(bind); + GntTreeRow *row = tree->current; + if (row->parent) { + int dist; + tree->current = row->parent; + if ((dist = get_distance(tree->current, tree->top)) > 0) + gnt_tree_scroll(tree, -dist); + else + redraw_tree(tree); + tree_selection_changed(tree, row, tree->current); + } + return TRUE; +} + +static gboolean action_up(GntBindable *bind, GList *list) { int dist; @@ -845,6 +862,8 @@ gnt_bindable_class_register_action(bindable, "move-down", action_down, GNT_KEY_DOWN, NULL); gnt_bindable_register_binding(bindable, "move-down", GNT_KEY_CTRL_N, NULL); + gnt_bindable_class_register_action(bindable, "move-parent", action_move_parent, + GNT_KEY_BACKSPACE, NULL); gnt_bindable_class_register_action(bindable, "page-up", action_page_up, GNT_KEY_PGUP, NULL); gnt_bindable_class_register_action(bindable, "page-down", action_page_down, @@ -1506,10 +1525,13 @@ int w = gnt_util_onscreen_width(col->text, NULL); if (i == 0 && row->choice) w += 4; + if (i == 0) { + w += find_depth(row) * TAB_SIZE; + } if (widths[i] < w) widths[i] = w; } - row = row->next; + row = get_next(row); } twidth = 1 + 2 * (!GNT_WIDGET_IS_FLAG_SET(GNT_WIDGET(tree), GNT_WIDGET_NO_BORDER)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |