diff options
Diffstat (limited to 'scene/gui/tree.cpp')
-rw-r--r-- | scene/gui/tree.cpp | 69 |
1 files changed, 37 insertions, 32 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 9f5b9f710d..58c829690f 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -949,8 +949,10 @@ void Tree::draw_item_rect(const TreeItem::Cell& p_cell,const Rect2i& p_rect,cons } -// if (p_tool) -// rect.size.x-=Math::floor(rect.size.y/2); + /* + if (p_tool) + rect.size.x-=Math::floor(rect.size.y/2); + */ Ref<Font> font = cache.font; @@ -1029,7 +1031,7 @@ int Tree::draw_item(const Point2i& p_pos,const Point2& p_draw_ofs, const Size2& } //draw separation. -// if (p_item->get_parent()!=root || !hide_root) + //if (p_item->get_parent()!=root || !hide_root) Ref<Font> font = cache.font; @@ -1115,7 +1117,7 @@ int Tree::draw_item(const Point2i& p_pos,const Point2& p_draw_ofs, const Size2& } else { cache.selected->draw(ci,r ); } - if (text_editor->is_visible()){ + if (text_editor->is_visible_in_tree()){ text_editor->set_pos(get_global_pos() + r.pos); } } @@ -1262,7 +1264,7 @@ int Tree::draw_item(const Point2i& p_pos,const Point2& p_draw_ofs, const Size2& } break; case TreeItem::CELL_MODE_CUSTOM: { - // int option = (int)p_item->cells[i].val; + //int option = (int)p_item->cells[i].val; @@ -1414,8 +1416,10 @@ void Tree::select_single_item(TreeItem *p_selected, TreeItem *p_current, int p_c emit_signal("item_selected"); emitted_row=true; } - //if (p_col==i) - // p_current->selected_signal.call(p_col); + /* + if (p_col==i) + p_current->selected_signal.call(p_col); + */ } else if (c.selected) { @@ -1672,9 +1676,11 @@ int Tree::propagate_mouse_event(const Point2i &p_pos,int x_ofs,int y_ofs,bool p_ } } - //if (!c.selected && select_mode==SELECT_MULTI) { - // emit_signal("multi_selected",p_item,col,true); - //} + /* + if (!c.selected && select_mode==SELECT_MULTI) { + emit_signal("multi_selected",p_item,col,true); + } + */ update(); } @@ -1997,7 +2003,7 @@ void Tree::_gui_input(InputEvent p_event) { } break; case KEY_LEFT: { -// TreeItem *next = NULL; + //TreeItem *next = NULL; if (!selected_item) break; if (select_mode==SELECT_ROW) @@ -2027,7 +2033,7 @@ void Tree::_gui_input(InputEvent p_event) { next=selected_item->get_next_visible(); -// if (diff < uint64_t(GLOBAL_DEF("gui/incr_search_max_interval_msec",2000))) { + //if (diff < uint64_t(GLOBAL_DEF("gui/incr_search_max_interval_msec",2000))) { if (last_keypress!=0) { //incr search next int col; @@ -2277,9 +2283,9 @@ void Tree::_gui_input(InputEvent p_event) { mpos.y-=_get_title_button_height(); if (mpos.y>=0) { - if (h_scroll->is_visible()) + if (h_scroll->is_visible_in_tree()) mpos.x+=h_scroll->get_value(); - if (v_scroll->is_visible()) + if (v_scroll->is_visible_in_tree()) mpos.y+=v_scroll->get_value(); int col,h,section; @@ -2470,7 +2476,7 @@ void Tree::_gui_input(InputEvent p_event) { if (!click_handled) { drag_speed=0; drag_accum=0; -// last_drag_accum=0; + //last_drag_accum=0; drag_from=v_scroll->get_value(); drag_touching=OS::get_singleton()->has_touchscreen_ui_hint(); drag_touching_deaccel=false; @@ -2567,7 +2573,7 @@ bool Tree::edit_selected() { value_editor->set_max( c.max ); value_editor->set_step( c.step ); value_editor->set_value( c.val ); - value_editor->set_exp_unit_value( c.expr ); + value_editor->set_exp_ratio( c.expr ); updating_value_editor=false; } @@ -2787,13 +2793,10 @@ void Tree::_notification(int p_what) { } int ofs=0; -// int from_y=exposed.pos.y+bg->get_margin(MARGIN_TOP); -// int size_y=exposed.size.height-bg->get_minimum_size().height; for (int i=0;i<(columns.size()-1-1);i++) { ofs+=get_column_width(i); - //get_painter()->draw_fill_rect( Point2(ofs+cache.hseparation/2, from_y), Size2( 1, size_y ),color( COLOR_TREE_GRID) ); } if (show_column_titles) { @@ -3016,8 +3019,10 @@ int Tree::get_edited_column() const { TreeItem* Tree::get_next_selected( TreeItem* p_item) { - //if (!p_item) - // return NULL; + /* + if (!p_item) + return NULL; + */ if (!root) return NULL; @@ -3069,7 +3074,7 @@ int Tree::get_column_width(int p_column) const { int expand_area=get_size().width-(bg->get_margin(MARGIN_LEFT)+bg->get_margin(MARGIN_RIGHT)); - if (v_scroll->is_visible()) + if (v_scroll->is_visible_in_tree()) expand_area-=v_scroll->get_combined_minimum_size().width; int expanding_columns=0; @@ -3254,9 +3259,9 @@ String Tree::get_column_title(int p_column) const { Point2 Tree::get_scroll() const { Point2 ofs; - if (h_scroll->is_visible()) + if (h_scroll->is_visible_in_tree()) ofs.x=h_scroll->get_value(); - if (v_scroll->is_visible()) + if (v_scroll->is_visible_in_tree()) ofs.y=v_scroll->get_value(); return ofs; @@ -3395,9 +3400,9 @@ int Tree::get_column_at_pos(const Point2& p_pos) const { if (pos.y<0) return -1; - if (h_scroll->is_visible()) + if (h_scroll->is_visible_in_tree()) pos.x+=h_scroll->get_value(); - if (v_scroll->is_visible()) + if (v_scroll->is_visible_in_tree()) pos.y+=v_scroll->get_value(); int col,h,section; @@ -3422,9 +3427,9 @@ int Tree::get_drop_section_at_pos(const Point2& p_pos) const { if (pos.y<0) return -100; - if (h_scroll->is_visible()) + if (h_scroll->is_visible_in_tree()) pos.x+=h_scroll->get_value(); - if (v_scroll->is_visible()) + if (v_scroll->is_visible_in_tree()) pos.y+=v_scroll->get_value(); int col,h,section; @@ -3449,9 +3454,9 @@ TreeItem* Tree::get_item_at_pos(const Point2& p_pos) const { if (pos.y<0) return NULL; - if (h_scroll->is_visible()) + if (h_scroll->is_visible_in_tree()) pos.x+=h_scroll->get_value(); - if (v_scroll->is_visible()) + if (v_scroll->is_visible_in_tree()) pos.y+=v_scroll->get_value(); int col,h,section; @@ -3477,9 +3482,9 @@ String Tree::get_tooltip(const Point2& p_pos) const { if (pos.y<0) return Control::get_tooltip(p_pos); - if (h_scroll->is_visible()) + if (h_scroll->is_visible_in_tree()) pos.x+=h_scroll->get_value(); - if (v_scroll->is_visible()) + if (v_scroll->is_visible_in_tree()) pos.y+=v_scroll->get_value(); int col,h,section; |