aboutsummaryrefslogtreecommitdiff
path: root/scene/gui/control.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2015-05-01 23:20:41 -0300
committerJuan Linietsky2015-05-01 23:20:41 -0300
commitdda60296d81edaabfdb56f47a2c949b5dad283fb (patch)
treeb41e31cc4620689a1e91adf852d0926fc600607a /scene/gui/control.cpp
parentfb8b740fcb50dc38526b458af096b72d1303d3e5 (diff)
parent61e90385f6cbeebb8d3d03c33078802c2fa11eda (diff)
downloadgodot-dda60296d81edaabfdb56f47a2c949b5dad283fb.tar.gz
godot-dda60296d81edaabfdb56f47a2c949b5dad283fb.tar.zst
godot-dda60296d81edaabfdb56f47a2c949b5dad283fb.zip
Diffstat (limited to 'scene/gui/control.cpp')
-rw-r--r--scene/gui/control.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index c539dc328..22559c238 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -138,22 +138,27 @@ bool Control::_set(const StringName& p_name, const Variant& p_value) {
if (name.begins_with("custom_icons/")) {
String dname = name.get_slice("/",1);
data.icon_override.erase(dname);
+ notification(NOTIFICATION_THEME_CHANGED);
update();
} else if (name.begins_with("custom_styles/")) {
String dname = name.get_slice("/",1);
data.style_override.erase(dname);
+ notification(NOTIFICATION_THEME_CHANGED);
update();
} else if (name.begins_with("custom_fonts/")) {
String dname = name.get_slice("/",1);
data.font_override.erase(dname);
+ notification(NOTIFICATION_THEME_CHANGED);
update();
} else if (name.begins_with("custom_colors/")) {
String dname = name.get_slice("/",1);
data.color_override.erase(dname);
+ notification(NOTIFICATION_THEME_CHANGED);
update();
} else if (name.begins_with("custom_constants/")) {
String dname = name.get_slice("/",1);
data.constant_override.erase(dname);
+ notification(NOTIFICATION_THEME_CHANGED);
update();
} else
return false;
@@ -161,19 +166,24 @@ bool Control::_set(const StringName& p_name, const Variant& p_value) {
} else {
if (name.begins_with("custom_icons/")) {
String dname = name.get_slice("/",1);
+ notification(NOTIFICATION_THEME_CHANGED);
add_icon_override(dname,p_value);
} else if (name.begins_with("custom_styles/")) {
String dname = name.get_slice("/",1);
add_style_override(dname,p_value);
+ notification(NOTIFICATION_THEME_CHANGED);
} else if (name.begins_with("custom_fonts/")) {
String dname = name.get_slice("/",1);
add_font_override(dname,p_value);
+ notification(NOTIFICATION_THEME_CHANGED);
} else if (name.begins_with("custom_colors/")) {
String dname = name.get_slice("/",1);
add_color_override(dname,p_value);
+ notification(NOTIFICATION_THEME_CHANGED);
} else if (name.begins_with("custom_constants/")) {
String dname = name.get_slice("/",1);
add_constant_override(dname,p_value);
+ notification(NOTIFICATION_THEME_CHANGED);
} else
return false;
}
@@ -514,13 +524,15 @@ void Control::_notification(int p_notification) {
if (data.MI) {
- data.window->window->modal_stack.erase(data.MI);
+ if (data.window && data.window->window)
+ data.window->window->modal_stack.erase(data.MI);
data.MI=NULL;
}
if (data.SI) {
//erase from subwindows
- data.window->window->subwindows.erase(data.SI);
+ if (data.window && data.window->window)
+ data.window->window->subwindows.erase(data.SI);
data.SI=NULL;
}