summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/theme.cpp30
-rw-r--r--scene/resources/theme.h6
2 files changed, 25 insertions, 11 deletions
diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp
index 69258bc834..ae18be1695 100644
--- a/scene/resources/theme.cpp
+++ b/scene/resources/theme.cpp
@@ -32,8 +32,6 @@
#include "core/os/file_access.h"
#include "core/print_string.h"
-Ref<Theme> Theme::default_theme;
-
void Theme::_emit_theme_changed() {
emit_changed();
@@ -186,11 +184,6 @@ void Theme::_get_property_list(List<PropertyInfo> *p_list) const {
}
}
-Ref<Theme> Theme::get_default() {
-
- return default_theme;
-}
-
void Theme::set_default_theme_font(const Ref<Font> &p_default_font) {
if (default_theme_font == p_default_font)
@@ -215,14 +208,31 @@ Ref<Font> Theme::get_default_theme_font() const {
return default_theme_font;
}
+Ref<Theme> Theme::project_default_theme;
+Ref<Theme> Theme::default_theme;
+Ref<Texture> Theme::default_icon;
+Ref<StyleBox> Theme::default_style;
+Ref<Font> Theme::default_font;
+
+Ref<Theme> Theme::get_default() {
+
+ return default_theme;
+}
+
void Theme::set_default(const Ref<Theme> &p_default) {
default_theme = p_default;
}
-Ref<Texture> Theme::default_icon;
-Ref<StyleBox> Theme::default_style;
-Ref<Font> Theme::default_font;
+Ref<Theme> Theme::get_project_default() {
+
+ return project_default_theme;
+}
+
+void Theme::set_project_default(const Ref<Theme> &p_project_default) {
+
+ project_default_theme = p_project_default;
+}
void Theme::set_default_icon(const Ref<Texture> &p_icon) {
diff --git a/scene/resources/theme.h b/scene/resources/theme.h
index fb59073cbe..4c4f9b5aba 100644
--- a/scene/resources/theme.h
+++ b/scene/resources/theme.h
@@ -46,7 +46,6 @@ class Theme : public Resource {
GDCLASS(Theme, Resource);
RES_BASE_EXTENSION("theme");
- static Ref<Theme> default_theme;
void _emit_theme_changed();
HashMap<StringName, HashMap<StringName, Ref<Texture> > > icon_map;
@@ -61,6 +60,8 @@ protected:
bool _get(const StringName &p_name, Variant &r_ret) const;
void _get_property_list(List<PropertyInfo> *p_list) const;
+ static Ref<Theme> project_default_theme;
+ static Ref<Theme> default_theme;
static Ref<Texture> default_icon;
static Ref<StyleBox> default_style;
static Ref<Font> default_font;
@@ -137,6 +138,9 @@ public:
static Ref<Theme> get_default();
static void set_default(const Ref<Theme> &p_default);
+ static Ref<Theme> get_project_default();
+ static void set_project_default(const Ref<Theme> &p_default);
+
static void set_default_icon(const Ref<Texture> &p_icon);
static void set_default_style(const Ref<StyleBox> &p_style);
static void set_default_font(const Ref<Font> &p_font);