diff --git a/src/filemanager/boxes.c b/src/filemanager/boxes.c index 2dbc75d65..6291ec5f0 100644 --- a/src/filemanager/boxes.c +++ b/src/filemanager/boxes.c @@ -1077,6 +1077,7 @@ char * tree_box (const char *current_dir) { WTree *mytree; + WRect r; WDialog *dlg; WGroup *g; Widget *wd; @@ -1091,7 +1092,8 @@ tree_box (const char *current_dir) g = GROUP (dlg); wd = WIDGET (dlg); - mytree = tree_new (2, 2, wd->rect.lines - 6, wd->rect.cols - 5, FALSE); + rect_init (&r, 2, 2, wd->rect.lines - 6, wd->rect.cols - 5); + mytree = tree_new (&r, FALSE); group_add_widget_autopos (g, mytree, WPOS_KEEP_ALL, NULL); group_add_widget_autopos (g, hline_new (wd->rect.lines - 4, 1, -1), WPOS_KEEP_BOTTOM, NULL); bar = buttonbar_new (); diff --git a/src/filemanager/layout.c b/src/filemanager/layout.c index d435bb29b..8fd70d5ba 100644 --- a/src/filemanager/layout.c +++ b/src/filemanager/layout.c @@ -1192,7 +1192,7 @@ create_panel (int num, panel_view_mode_t type) break; case view_tree: - new_widget = WIDGET (tree_new (r.y, r.x, r.lines, r.cols, TRUE)); + new_widget = WIDGET (tree_new (&r, TRUE)); break; case view_quick: diff --git a/src/filemanager/tree.c b/src/filemanager/tree.c index 6f86693d2..6b16dd8e6 100644 --- a/src/filemanager/tree.c +++ b/src/filemanager/tree.c @@ -1282,16 +1282,15 @@ tree_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event) /* --------------------------------------------------------------------------------------------- */ WTree * -tree_new (int y, int x, int lines, int cols, gboolean is_panel) +tree_new (const WRect * r, gboolean is_panel) { - WRect r = { y, x, lines, cols }; WTree *tree; Widget *w; tree = g_new (WTree, 1); w = WIDGET (tree); - widget_init (w, &r, tree_callback, tree_mouse_callback); + widget_init (w, r, tree_callback, tree_mouse_callback); w->options |= WOP_SELECTABLE | WOP_TOP_SELECT; w->keymap = tree_map; diff --git a/src/filemanager/tree.h b/src/filemanager/tree.h index f1dbba686..5fda4a4fc 100644 --- a/src/filemanager/tree.h +++ b/src/filemanager/tree.h @@ -22,7 +22,7 @@ extern gboolean xtree_mode; /*** declarations of public functions ************************************************************/ -WTree *tree_new (int y, int x, int lines, int cols, gboolean is_panel); +WTree *tree_new (const WRect * r, gboolean is_panel); void tree_chdir (WTree * tree, const vfs_path_t * dir); const vfs_path_t *tree_selected_name (const WTree * tree);