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. |