summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-01-14 12:26:56 +0100
committerRémi Verschelde <rverschelde@gmail.com>2017-01-14 14:52:23 +0100
commit93ab45b6b5c4f8e0619e963156c983009d399a9d (patch)
tree80e55993f29ad7bf502ef7388eef78114b2dc4ab /scene/gui
parent78e90ac60b81f17fdf8c319357f16962e92e6106 (diff)
Style: Fix whole-line commented code
They do not play well with clang-format which aligns the `//` part with the rest of the code block, thus producing badly indented commented code.
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/base_button.cpp2
-rw-r--r--scene/gui/box_container.cpp2
-rw-r--r--scene/gui/control.cpp22
-rw-r--r--scene/gui/dialogs.h2
-rw-r--r--scene/gui/graph_edit.cpp2
-rw-r--r--scene/gui/grid_container.cpp4
-rw-r--r--scene/gui/line_edit.cpp4
-rw-r--r--scene/gui/patch_9_rect.cpp8
-rw-r--r--scene/gui/popup_menu.cpp2
-rw-r--r--scene/gui/scroll_bar.cpp34
-rw-r--r--scene/gui/slider.cpp12
-rw-r--r--scene/gui/spin_box.cpp6
-rw-r--r--scene/gui/text_edit.cpp6
-rw-r--r--scene/gui/text_edit.h2
-rw-r--r--scene/gui/texture_rect.cpp6
-rw-r--r--scene/gui/tree.cpp39
-rw-r--r--scene/gui/tree.h2
-rw-r--r--scene/gui/video_player.cpp2
18 files changed, 92 insertions, 65 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index 8949a080c1..0b40983ddf 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -108,7 +108,7 @@ void BaseButton::_gui_input(InputEvent p_event) {
emit_signal("button_up");
/* this is pointless if (status.press_attempt && status.pressing_inside) {
-// released();
+ //released();
emit_signal("released");
}
*/
diff --git a/scene/gui/box_container.cpp b/scene/gui/box_container.cpp
index 600b6141c5..7ca44ac27b 100644
--- a/scene/gui/box_container.cpp
+++ b/scene/gui/box_container.cpp
@@ -296,7 +296,7 @@ BoxContainer::BoxContainer(bool p_vertical) {
vertical=p_vertical;
align = ALIGN_BEGIN;
-// set_ignore_mouse(true);
+ //set_ignore_mouse(true);
set_mouse_filter(MOUSE_FILTER_PASS);
}
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 2e6dd48442..533d24f998 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -468,10 +468,12 @@ void Control::_notification(int p_notification) {
}
- //if (data.theme.is_null() && data.parent && data.parent->data.theme_owner) {
- // data.theme_owner=data.parent->data.theme_owner;
- // notification(NOTIFICATION_THEME_CHANGED);
- //}
+ /*
+ if (data.theme.is_null() && data.parent && data.parent->data.theme_owner) {
+ data.theme_owner=data.parent->data.theme_owner;
+ notification(NOTIFICATION_THEME_CHANGED);
+ }
+ */
} break;
case NOTIFICATION_EXIT_CANVAS: {
@@ -503,10 +505,12 @@ void Control::_notification(int p_notification) {
data.parent=NULL;
data.parent_canvas_item=NULL;
- //if (data.theme_owner && data.theme.is_null()) {
- // data.theme_owner=NULL;
- //notification(NOTIFICATION_THEME_CHANGED);
- //}
+ /*
+ if (data.theme_owner && data.theme.is_null()) {
+ data.theme_owner=NULL;
+ notification(NOTIFICATION_THEME_CHANGED);
+ }
+ */
} break;
case NOTIFICATION_MOVED_IN_PARENT: {
@@ -2444,7 +2448,7 @@ bool Control::is_clipping_contents() {
void Control::_bind_methods() {
-// ClassDB::bind_method(_MD("_window_resize_event"),&Control::_window_resize_event);
+ //ClassDB::bind_method(_MD("_window_resize_event"),&Control::_window_resize_event);
ClassDB::bind_method(_MD("_size_changed"),&Control::_size_changed);
ClassDB::bind_method(_MD("_update_minimum_size"),&Control::_update_minimum_size);
diff --git a/scene/gui/dialogs.h b/scene/gui/dialogs.h
index c7beeea7a3..6650c5eb5d 100644
--- a/scene/gui/dialogs.h
+++ b/scene/gui/dialogs.h
@@ -94,7 +94,7 @@ class AcceptDialog : public WindowDialog {
HBoxContainer *hbc;
Label *label;
Button *ok;
-// Button *cancel; no more cancel (there is X on tht titlebar)
+ //Button *cancel; no more cancel (there is X on tht titlebar)
bool hide_on_ok;
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp
index 2a73e32864..ba1ab1afa8 100644
--- a/scene/gui/graph_edit.cpp
+++ b/scene/gui/graph_edit.cpp
@@ -295,7 +295,7 @@ void GraphEdit::_notification(int p_what) {
zoom_reset->set_icon(get_icon("reset"));
zoom_plus->set_icon(get_icon("more"));
snap_button->set_icon(get_icon("snap"));
-// zoom_icon->set_texture( get_icon("Zoom", "EditorIcons"));
+ //zoom_icon->set_texture( get_icon("Zoom", "EditorIcons"));
}
if (p_what==NOTIFICATION_DRAW) {
diff --git a/scene/gui/grid_container.cpp b/scene/gui/grid_container.cpp
index 7c67d443af..597169ca83 100644
--- a/scene/gui/grid_container.cpp
+++ b/scene/gui/grid_container.cpp
@@ -70,7 +70,7 @@ void GridContainer::_notification(int p_what) {
else
row_minh[row]=ms.height;
- // print_line("store row "+itos(row)+" mw "+itos(ms.height));
+ //print_line("store row "+itos(row)+" mw "+itos(ms.height));
if (c->get_h_size_flags()&SIZE_EXPAND)
col_expanded.insert(col);
@@ -136,7 +136,7 @@ void GridContainer::_notification(int p_what) {
Point2 p(col_ofs,row_ofs);
-// print_line("col: "+itos(col)+" row: "+itos(row)+" col_ofs: "+itos(col_ofs)+" row_ofs: "+itos(row_ofs));
+ //print_line("col: "+itos(col)+" row: "+itos(row)+" col_ofs: "+itos(col_ofs)+" row_ofs: "+itos(row_ofs));
fit_child_in_rect(c,Rect2(p,s));
//print_line("col: "+itos(col)+" row: "+itos(row)+" rect: "+Rect2(p,s));
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 89a937a301..3a72e0e445 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -96,8 +96,6 @@ void LineEdit::_gui_input(InputEvent p_event) {
}
}
- // if (!editable)
- // non_editable_clicked_signal.call();
update();
} else {
@@ -873,7 +871,7 @@ void LineEdit::delete_char() {
if (cursor_pos==window_pos) {
- // set_window_pos(cursor_pos-get_window_length());
+ //set_window_pos(cursor_pos-get_window_length());
}
_text_changed();
diff --git a/scene/gui/patch_9_rect.cpp b/scene/gui/patch_9_rect.cpp
index 698d4aaf29..4e1856778e 100644
--- a/scene/gui/patch_9_rect.cpp
+++ b/scene/gui/patch_9_rect.cpp
@@ -40,7 +40,7 @@ void NinePatchRect::_notification(int p_what) {
Size2 s=get_size();
RID ci = get_canvas_item();
VS::get_singleton()->canvas_item_add_nine_patch(ci,Rect2(Point2(),s),region_rect,texture->get_rid(),Vector2(margin[MARGIN_LEFT],margin[MARGIN_TOP]),Vector2(margin[MARGIN_RIGHT],margin[MARGIN_BOTTOM]),VS::NINE_PATCH_STRETCH,VS::NINE_PATCH_STRETCH,draw_center);
-// draw_texture_rect(texture,Rect2(Point2(),s),false,modulate);
+ //draw_texture_rect(texture,Rect2(Point2(),s),false,modulate);
/*
Vector<Point2> points;
@@ -98,8 +98,10 @@ void NinePatchRect::set_texture(const Ref<Texture>& p_tex) {
return;
texture=p_tex;
update();
- //if (texture.is_valid())
- // texture->set_flags(texture->get_flags()&(~Texture::FLAG_REPEAT)); //remove repeat from texture, it looks bad in sprites
+ /*
+ if (texture.is_valid())
+ texture->set_flags(texture->get_flags()&(~Texture::FLAG_REPEAT)); //remove repeat from texture, it looks bad in sprites
+ */
minimum_size_changed();
emit_signal("texture_changed");
}
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index c5ac6778a9..65e7c3ab39 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -136,7 +136,7 @@ int PopupMenu::_get_mouse_over(const Point2& p_over) const {
Ref<Font> font = get_font("font");
int vseparation = get_constant("vseparation");
-// int hseparation = get_constant("hseparation");
+ //int hseparation = get_constant("hseparation");
float font_h=font->get_height();
diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp
index da267b9f27..fc406ff0f5 100644
--- a/scene/gui/scroll_bar.cpp
+++ b/scene/gui/scroll_bar.cpp
@@ -51,9 +51,11 @@ void ScrollBar::_gui_input(InputEvent p_event) {
if (b.button_index==5 && b.pressed) {
- //if (orientation==VERTICAL)
- // set_val( get_val() + get_page() / 4.0 );
- //else
+ /*
+ if (orientation==VERTICAL)
+ set_val( get_val() + get_page() / 4.0 );
+ else
+ */
set_value( get_value() + get_page() / 4.0 );
accept_event();
@@ -61,9 +63,11 @@ void ScrollBar::_gui_input(InputEvent p_event) {
if (b.button_index==4 && b.pressed) {
- //if (orientation==HORIZONTAL)
- // set_val( get_val() - get_page() / 4.0 );
- //else
+ /*
+ if (orientation==HORIZONTAL)
+ set_val( get_val() - get_page() / 4.0 );
+ else
+ */
set_value( get_value() - get_page() / 4.0 );
accept_event();
}
@@ -425,8 +429,10 @@ double ScrollBar::get_grabber_size() const {
return 0;
float page = (get_page()>0)? get_page() : 0;
-// if (grabber_range < get_step())
-// grabber_range=get_step();
+ /*
+ if (grabber_range < get_step())
+ grabber_range=get_step();
+ */
double area_size=get_area_size();
double grabber_size = page / range * area_size;
@@ -620,12 +626,16 @@ void ScrollBar::_drag_slave_input(const InputEvent& p_input) {
if (orientation==HORIZONTAL)
set_value(diff.x);
- //else
- // drag_slave_accum.x=0;
+ /*
+ else
+ drag_slave_accum.x=0;
+ */
if (orientation==VERTICAL)
set_value(diff.y);
- //else
- // drag_slave_accum.y=0;
+ /*
+ else
+ drag_slave_accum.y=0;
+ */
time_since_motion=0;
}
diff --git a/scene/gui/slider.cpp b/scene/gui/slider.cpp
index a7cc38846d..ad6e8786d7 100644
--- a/scene/gui/slider.cpp
+++ b/scene/gui/slider.cpp
@@ -164,8 +164,10 @@ void Slider::_notification(int p_what) {
if (orientation==VERTICAL) {
style->draw(ci,Rect2i(Point2i(),Size2i(style->get_minimum_size().width+style->get_center_size().width,size.height)));
- //if (mouse_inside||has_focus())
- // focus->draw(ci,Rect2i(Point2i(),Size2i(style->get_minimum_size().width+style->get_center_size().width,size.height)));
+ /*
+ if (mouse_inside||has_focus())
+ focus->draw(ci,Rect2i(Point2i(),Size2i(style->get_minimum_size().width+style->get_center_size().width,size.height)));
+ */
float areasize = size.height - grabber->get_size().height;
if (ticks>1) {
int tickarea = size.height - tick->get_height();
@@ -179,8 +181,10 @@ void Slider::_notification(int p_what) {
grabber->draw(ci,Point2i(size.width/2-grabber->get_size().width/2,size.height - get_as_ratio()*areasize - grabber->get_size().height));
} else {
style->draw(ci,Rect2i(Point2i(),Size2i(size.width,style->get_minimum_size().height+style->get_center_size().height)));
- //if (mouse_inside||has_focus())
- // focus->draw(ci,Rect2i(Point2i(),Size2i(size.width,style->get_minimum_size().height+style->get_center_size().height)));
+ /*
+ if (mouse_inside||has_focus())
+ focus->draw(ci,Rect2i(Point2i(),Size2i(size.width,style->get_minimum_size().height+style->get_center_size().height)));
+ */
float areasize = size.width - grabber->get_size().width;
if (ticks>1) {
diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp
index 070f9fc72e..ec6be0d19d 100644
--- a/scene/gui/spin_box.cpp
+++ b/scene/gui/spin_box.cpp
@@ -49,8 +49,10 @@ void SpinBox::_value_changed(double) {
void SpinBox::_text_entered(const String& p_string) {
- //if (!p_string.is_numeric())
- // return;
+ /*
+ if (!p_string.is_numeric())
+ return;
+ */
String value = p_string;
if (prefix!="" && p_string.begins_with(prefix))
value = p_string.substr(prefix.length(), p_string.length()-prefix.length());
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 46939765b0..8efff21fc9 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -4357,7 +4357,7 @@ void TextEdit::_update_completion_candidates() {
if (completion_options.size()==1) {
//one option to complete, just complete it automagically
_confirm_completion();
- // insert_text_at_cursor(completion_options[0].substr(s.length(),completion_options[0].length()-s.length()));
+ //insert_text_at_cursor(completion_options[0].substr(s.length(),completion_options[0].length()-s.length()));
_cancel_completion();
return;
@@ -4732,8 +4732,8 @@ TextEdit::TextEdit() {
tab_size=4;
text.set_tab_size(tab_size);
text.clear();
- // text.insert(1,"Mongolia..");
- // text.insert(2,"PAIS GENEROSO!!");
+ //text.insert(1,"Mongolia..");
+ //text.insert(2,"PAIS GENEROSO!!");
text.set_color_regions(&color_regions);
h_scroll = memnew( HScrollBar );
diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h
index c7467f9b13..6113fd72c2 100644
--- a/scene/gui/text_edit.h
+++ b/scene/gui/text_edit.h
@@ -294,7 +294,7 @@ class TextEdit : public Control {
void _scroll_lines_up();
void _scroll_lines_down();
-// void mouse_motion(const Point& p_pos, const Point& p_rel, int p_button_mask);
+ //void mouse_motion(const Point& p_pos, const Point& p_rel, int p_button_mask);
Size2 get_minimum_size() const;
int get_row_height() const;
diff --git a/scene/gui/texture_rect.cpp b/scene/gui/texture_rect.cpp
index 68755c0ac2..cbb077ef5d 100644
--- a/scene/gui/texture_rect.cpp
+++ b/scene/gui/texture_rect.cpp
@@ -121,8 +121,10 @@ void TextureRect::set_texture(const Ref<Texture>& p_tex) {
texture=p_tex;
update();
- //if (texture.is_valid())
- // texture->set_flags(texture->get_flags()&(~Texture::FLAG_REPEAT)); //remove repeat from texture, it looks bad in sprites
+ /*
+ if (texture.is_valid())
+ texture->set_flags(texture->get_flags()&(~Texture::FLAG_REPEAT)); //remove repeat from texture, it looks bad in sprites
+ */
minimum_size_changed();
}
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index b50ecc58ef..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;
@@ -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;
@@ -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;
@@ -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;
diff --git a/scene/gui/tree.h b/scene/gui/tree.h
index 8327e356b3..d715ff4772 100644
--- a/scene/gui/tree.h
+++ b/scene/gui/tree.h
@@ -334,7 +334,7 @@ friend class TreeItem;
int compute_item_height(TreeItem *p_item) const;
int get_item_height(TreeItem *p_item) const;
-// void draw_item_text(String p_text,const Ref<Texture>& p_icon,int p_icon_max_w,bool p_tool,Rect2i p_rect,const Color& p_color);
+ //void draw_item_text(String p_text,const Ref<Texture>& p_icon,int p_icon_max_w,bool p_tool,Rect2i p_rect,const Color& p_color);
void draw_item_rect(const TreeItem::Cell& p_cell,const Rect2i& p_rect,const Color& p_color);
int draw_item(const Point2i& p_pos,const Point2& p_draw_ofs, const Size2& p_draw_size,TreeItem *p_item);
void select_single_item(TreeItem *p_selected,TreeItem *p_current,int p_col,TreeItem *p_prev=NULL,bool *r_in_range=NULL,bool p_force_deselect=false);
diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp
index f7d2ad1c63..4c177ea53c 100644
--- a/scene/gui/video_player.cpp
+++ b/scene/gui/video_player.cpp
@@ -394,7 +394,7 @@ void VideoPlayer::_bind_methods() {
ADD_PROPERTY( PropertyInfo(Variant::INT, "audio_track",PROPERTY_HINT_RANGE,"0,128,1"), _SCS("set_audio_track"), _SCS("get_audio_track") );
ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE,"VideoStream"), _SCS("set_stream"), _SCS("get_stream") );
-// ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/loop"), _SCS("set_loop"), _SCS("has_loop") );
+ //ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/loop"), _SCS("set_loop"), _SCS("has_loop") );
ADD_PROPERTY( PropertyInfo(Variant::REAL, "volume_db", PROPERTY_HINT_RANGE,"-80,24,0.01"), _SCS("set_volume_db"), _SCS("get_volume_db") );
ADD_PROPERTY( PropertyInfo(Variant::BOOL, "autoplay"), _SCS("set_autoplay"), _SCS("has_autoplay") );
ADD_PROPERTY( PropertyInfo(Variant::BOOL, "paused"), _SCS("set_paused"), _SCS("is_paused") );