diff options
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/box_container.cpp | 2 | ||||
-rw-r--r-- | scene/gui/control.cpp | 8 | ||||
-rw-r--r-- | scene/gui/dialogs.cpp | 16 | ||||
-rw-r--r-- | scene/gui/rich_text_label.cpp | 2 | ||||
-rw-r--r-- | scene/gui/scroll_bar.cpp | 2 | ||||
-rw-r--r-- | scene/gui/tree.cpp | 2 |
6 files changed, 24 insertions, 8 deletions
diff --git a/scene/gui/box_container.cpp b/scene/gui/box_container.cpp index 7c1487c42f..1096c43c10 100644 --- a/scene/gui/box_container.cpp +++ b/scene/gui/box_container.cpp @@ -98,7 +98,7 @@ void BoxContainer::_resort() { elements exist */ bool has_stretched = false; - while (stretch_ratio_total > 0) { // first of all, dont even be here if no stretchable objects exist + while (stretch_ratio_total > 0) { // first of all, don't even be here if no stretchable objects exist has_stretched = true; bool refit_successful = true; //assume refit-test will go well diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 7779391bae..d2f3eea721 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -485,7 +485,7 @@ void Control::_notification(int p_notification) { } break; case NOTIFICATION_MOVED_IN_PARENT: { // some parents need to know the order of the childrens to draw (like TabContainer) - // update if necesary + // update if necessary if (data.parent) data.parent->update(); update(); @@ -692,7 +692,7 @@ Size2 Control::get_minimum_size() const { if (si) { Variant::CallError ce; - Variant s = si->call(SceneStringNames::get_singleton()->get_minimum_size, NULL, 0, ce); + Variant s = si->call(SceneStringNames::get_singleton()->_get_minimum_size, NULL, 0, ce); if (ce.error == Variant::CallError::CALL_OK) return s; } @@ -2419,7 +2419,7 @@ void Control::_bind_methods() { ClassDB::bind_method(D_METHOD("_font_changed"), &Control::_font_changed); BIND_VMETHOD(MethodInfo("_gui_input", PropertyInfo(Variant::INPUT_EVENT, "event"))); - BIND_VMETHOD(MethodInfo(Variant::VECTOR2, "get_minimum_size")); + BIND_VMETHOD(MethodInfo(Variant::VECTOR2, "_get_minimum_size")); BIND_VMETHOD(MethodInfo(Variant::OBJECT, "get_drag_data", PropertyInfo(Variant::VECTOR2, "pos"))); BIND_VMETHOD(MethodInfo(Variant::BOOL, "can_drop_data", PropertyInfo(Variant::VECTOR2, "pos"), PropertyInfo(Variant::NIL, "data"))); BIND_VMETHOD(MethodInfo("drop_data", PropertyInfo(Variant::VECTOR2, "pos"), PropertyInfo(Variant::NIL, "data"))); @@ -2514,6 +2514,8 @@ void Control::_bind_methods() { ADD_SIGNAL(MethodInfo("size_flags_changed")); ADD_SIGNAL(MethodInfo("minimum_size_changed")); ADD_SIGNAL(MethodInfo("modal_closed")); + + BIND_VMETHOD(MethodInfo("has_point", PropertyInfo(Variant::VECTOR2, "point"))); } Control::Control() { diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index d081eda86d..35d54d9843 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -31,6 +31,10 @@ #include "print_string.h" #include "translation.h" +#ifdef TOOLS_ENABLED +#include "editor/editor_node.h" +#endif + void WindowDialog::_post_popup() { drag_type = DRAG_NONE; // just in case @@ -38,7 +42,7 @@ void WindowDialog::_post_popup() { void WindowDialog::_fix_size() { - // Perhaps this should be called when the viewport resizes aswell or windows go out of bounds... + // Perhaps this should be called when the viewport resizes as well or windows go out of bounds... // Ensure the whole window is visible. Point2i pos = get_global_pos(); @@ -199,6 +203,16 @@ void WindowDialog::_notification(int p_what) { set_default_cursor_shape(CURSOR_ARROW); } } break; +#ifdef TOOLS_ENABLED + case NOTIFICATION_POST_POPUP: { + if (get_tree() && get_tree()->is_editor_hint() && EditorNode::get_singleton()) + EditorNode::get_singleton()->dim_editor(true); + } break; + case NOTIFICATION_POPUP_HIDE: { + if (get_tree() && get_tree()->is_editor_hint() && EditorNode::get_singleton()) + EditorNode::get_singleton()->dim_editor(false); + } break; +#endif } } diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 322d9dee20..eaa2a66a56 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -125,7 +125,7 @@ void RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int if (cfont.is_null()) cfont = p_base_font; - //line height should be the font height for the first time, this ensures that an empty line will never have zero height and succesive newlines are displayed + //line height should be the font height for the first time, this ensures that an empty line will never have zero height and successive newlines are displayed int line_height = cfont->get_height(); Variant meta; diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index 37f7b46e22..b27104f788 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -705,7 +705,7 @@ void ScrollBar::mouse_motion(const Point2& p_pos, const Point2& p_rel, int b.but if (value_ofs>(get_max()-get_page())) value_ofs=get_max()-get_page(); if (get_val()==value_ofs) - return; //dont bother if the value is the same + return; //don't bother if the value is the same set_val( value_ofs ); diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index d63ef41239..9a999c9323 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2912,7 +2912,7 @@ int Tree::get_column_width(int p_column) const { if (expand_area < expanding_total) return columns[p_column].min_width; - ERR_FAIL_COND_V(expanding_columns == 0, -1); // shouldnt happen + ERR_FAIL_COND_V(expanding_columns == 0, -1); // shouldn't happen return expand_area * columns[p_column].min_width / expanding_total; } |