aboutsummaryrefslogtreecommitdiff
path: root/scene/gui/control.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/control.cpp')
-rw-r--r--scene/gui/control.cpp40
1 files changed, 22 insertions, 18 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 054622668..533d24f99 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: {
@@ -565,7 +569,7 @@ void Control::_notification(int p_notification) {
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {
- if (!is_visible()) {
+ if (!is_visible_in_tree()) {
if(get_viewport() != NULL)
get_viewport()->_gui_hid_control(this);
@@ -1660,7 +1664,7 @@ static Control *_next_control(Control *p_from) {
for(int i=(next+1);i<parent->get_child_count();i++) {
Control *c = parent->get_child(i)->cast_to<Control>();
- if (!c || !c->is_visible() || c->is_set_as_toplevel())
+ if (!c || !c->is_visible_in_tree() || c->is_set_as_toplevel())
continue;
return c;
@@ -1685,7 +1689,7 @@ Control *Control::find_next_valid_focus() const {
for(int i=0;i<from->get_child_count();i++) {
Control *c = from->get_child(i)->cast_to<Control>();
- if (!c || !c->is_visible() || c->is_set_as_toplevel()) {
+ if (!c || !c->is_visible_in_tree() || c->is_set_as_toplevel()) {
continue;
}
@@ -1751,7 +1755,7 @@ static Control *_prev_control(Control *p_from) {
for(int i=p_from->get_child_count()-1;i>=0;i--) {
Control *c = p_from->get_child(i)->cast_to<Control>();
- if (!c || !c->is_visible() || c->is_set_as_toplevel())
+ if (!c || !c->is_visible_in_tree() || c->is_set_as_toplevel())
continue;
child=c;
@@ -1791,7 +1795,7 @@ Control *Control::find_prev_valid_focus() const {
Control *c = from->get_parent()->get_child(i)->cast_to<Control>();
- if (!c || !c->is_visible() || c->is_set_as_toplevel()) {
+ if (!c || !c->is_visible_in_tree() || c->is_set_as_toplevel()) {
continue;
}
@@ -1875,7 +1879,7 @@ void Control::show_modal(bool p_exclusive) {
ERR_FAIL_COND(!is_inside_tree());
ERR_FAIL_COND(!data.SI);
- if (is_visible())
+ if (is_visible_in_tree())
hide();
ERR_FAIL_COND( data.MI!=NULL );
@@ -1883,7 +1887,7 @@ void Control::show_modal(bool p_exclusive) {
raise();
data.modal_exclusive=p_exclusive;
data.MI=get_viewport()->_gui_show_modal(this);
- data.modal_frame=OS::get_singleton()->get_frames_drawn();
+ data.modal_frame=Engine::get_singleton()->get_frames_drawn();
}
@@ -2053,7 +2057,7 @@ Control *Control::_get_focus_neighbour(Margin p_margin,int p_count) {
return NULL;
}
bool valid=true;
- if (c->is_hidden())
+ if (!c->is_visible())
valid=false;
if (c->get_focus_mode()==FOCUS_NONE)
valid=false;
@@ -2126,7 +2130,7 @@ void Control::_window_find_focus_neighbour(const Vector2& p_dir, Node *p_at,cons
Control *c = p_at->cast_to<Control>();
- if (c && c !=this && c->get_focus_mode()==FOCUS_ALL && c->is_visible()) {
+ if (c && c !=this && c->get_focus_mode()==FOCUS_ALL && c->is_visible_in_tree()) {
Point2 points[4];
@@ -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);