Revision e23bc35af900cf0925d85813b5896e19f73645d2
sadrul at pidgin.im
sadrul at pidgin.im
Sat Mar 31 23:49:49 EDT 2007
o -----------------------------------------------------------------
| Revision: e23bc35af900cf0925d85813b5896e19f73645d2
| Ancestor: 2c65471fa441207442778d71677b107f6e932b95
| Author: sadrul at pidgin.im
| Date: 2007-04-01T03:46:58
| Branch: im.pidgin.pidgin
|
| Modified files:
| finch/libgnt/gnttree.c
|
| ChangeLog:
|
| Backspace to jump to parent.
|
| ============================================================
| --- finch/libgnt/gnttree.c b4770c2e891604b038ebc559e843e06b994cf7cf
| +++ finch/libgnt/gnttree.c 4073129f51c0c4abc120a9ac28309380a39a0183
| @@ -567,6 +567,23 @@ static gboolean
| }
|
| 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_tree_class_init(GntTreeClass *klass)
| 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 @@ void gnt_tree_adjust_columns(GntTree *tr
| 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));
To get the patch for this revision, please do this:
mtn log --last 1 --diffs --from e23bc35af900cf0925d85813b5896e19f73645d2
More information about the Commits
mailing list