summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/control.cpp11
-rw-r--r--scene/gui/control.h2
-rw-r--r--scene/gui/dialogs.cpp4
-rw-r--r--scene/gui/popup.cpp4
-rw-r--r--scene/gui/popup_menu.h2
-rw-r--r--scene/gui/tree.cpp4
6 files changed, 23 insertions, 4 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index ce268843b1..a8070be91d 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -2267,8 +2267,10 @@ void Control::_window_sort_subwindows() {
if (!window->subwindow_order_dirty)
return;
+
window->modal_stack.sort_custom<CComparator>();
window->subwindows.sort_custom<CComparator>();
+
window->subwindow_order_dirty=false;
}
@@ -2688,6 +2690,12 @@ Control *Control::get_focus_owner() const {
return data.window->window->key_focus;
}
+
+void Control::warp_mouse(const Point2& p_to_pos) {
+ ERR_FAIL_COND(!is_inside_tree());
+ get_viewport()->warp_mouse(get_global_transform().xform(p_to_pos));
+}
+
void Control::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_window_input_event"),&Control::_window_input_event);
@@ -2784,6 +2792,9 @@ void Control::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_drag_preview","control:Control"),&Control::set_drag_preview);
+ ObjectTypeDB::bind_method(_MD("warp_mouse","to_pos"),&Control::warp_mouse);
+
+
BIND_VMETHOD(MethodInfo("_input_event",PropertyInfo(Variant::INPUT_EVENT,"event")));
BIND_VMETHOD(MethodInfo(Variant::VECTOR2,"get_minimum_size"));
BIND_VMETHOD(MethodInfo(Variant::OBJECT,"get_drag_data",PropertyInfo(Variant::VECTOR2,"pos")));
diff --git a/scene/gui/control.h b/scene/gui/control.h
index 64b5a9b661..7e14bff098 100644
--- a/scene/gui/control.h
+++ b/scene/gui/control.h
@@ -380,7 +380,7 @@ public:
void grab_click_focus();
-
+ void warp_mouse(const Point2& p_to_pos);
Control();
~Control();
diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp
index a82cfc7ea6..30e0241f23 100644
--- a/scene/gui/dialogs.cpp
+++ b/scene/gui/dialogs.cpp
@@ -328,8 +328,8 @@ AcceptDialog::AcceptDialog() {
label->set_anchor(MARGIN_RIGHT,ANCHOR_END);
label->set_anchor(MARGIN_BOTTOM,ANCHOR_END);
label->set_begin( Point2( margin, margin) );
- label->set_end( Point2( margin, button_margin) );
- label->set_autowrap(true);
+ label->set_end( Point2( margin, button_margin+10) );
+ //label->set_autowrap(true);
add_child(label);
hbc = memnew( HBoxContainer );
diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp
index bccd05d4fe..d58cb3da79 100644
--- a/scene/gui/popup.cpp
+++ b/scene/gui/popup.cpp
@@ -94,6 +94,8 @@ void Popup::popup_centered_minsize(const Size2& p_minsize) {
Control *c=get_child(i)->cast_to<Control>();
if (!c)
continue;
+ if (c->is_hidden())
+ continue;
Size2 minsize = c->get_combined_minimum_size();
@@ -114,6 +116,8 @@ void Popup::popup_centered_minsize(const Size2& p_minsize) {
}
+ print_line(String(c->get_type())+": "+minsize);
+
total_minsize.width = MAX( total_minsize.width, minsize.width );
total_minsize.height = MAX( total_minsize.height, minsize.height );
}
diff --git a/scene/gui/popup_menu.h b/scene/gui/popup_menu.h
index c2e988de95..d825ea2b68 100644
--- a/scene/gui/popup_menu.h
+++ b/scene/gui/popup_menu.h
@@ -90,7 +90,7 @@ public:
void add_icon_check_item(const Ref<Texture>& p_icon,const String& p_label,int p_ID=-1,uint32_t p_accel=0);
void add_check_item(const String& p_label,int p_ID=-1,uint32_t p_accel=0);
void add_submenu_item(const String& p_label,const String& p_submenu, int p_ID=-1);
-
+
void set_item_text(int p_idx,const String& p_text);
void set_item_icon(int p_idx,const Ref<Texture>& p_icon);
void set_item_checked(int p_idx,bool p_checked);
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index b7b52a39dc..035dbb8cc4 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -2472,6 +2472,10 @@ void Tree::_notification(int p_what) {
}
}
+ if (p_what==NOTIFICATION_THEME_CHANGED) {
+ update_cache();
+ }
+
}