summaryrefslogtreecommitdiff
path: root/scene/main/window.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-09-01 19:09:33 +0200
committerGitHub <noreply@github.com>2022-09-01 19:09:33 +0200
commit8c7be63588bf3e4ef4b780ff57936c68db5939c7 (patch)
tree781068f8e33aa1704f4fe9d9f4a238397fbee8f1 /scene/main/window.h
parentdcd74563b64fb45323c5d99e1382125488b863e8 (diff)
parent15fd025f900de9ff45e60e4b07d8839352d5a1f4 (diff)
Merge pull request #65192 from YuriSizov/control-customizable-cache-p2
Diffstat (limited to 'scene/main/window.h')
-rw-r--r--scene/main/window.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/scene/main/window.h b/scene/main/window.h
index 238be484c0..5a42c5bb83 100644
--- a/scene/main/window.h
+++ b/scene/main/window.h
@@ -32,12 +32,12 @@
#define WINDOW_H
#include "scene/main/viewport.h"
+#include "scene/resources/theme.h"
class Control;
class Font;
class Shortcut;
class StyleBox;
-class Theme;
class Window : public Viewport {
GDCLASS(Window, Viewport)
@@ -141,6 +141,18 @@ private:
Window *theme_owner_window = nullptr;
StringName theme_type_variation;
+ mutable HashMap<StringName, Theme::ThemeIconMap> theme_icon_cache;
+ mutable HashMap<StringName, Theme::ThemeStyleMap> theme_style_cache;
+ mutable HashMap<StringName, Theme::ThemeFontMap> theme_font_cache;
+ mutable HashMap<StringName, Theme::ThemeFontSizeMap> theme_font_size_cache;
+ mutable HashMap<StringName, Theme::ThemeColorMap> theme_color_cache;
+ mutable HashMap<StringName, Theme::ThemeConstantMap> theme_constant_cache;
+
+ _FORCE_INLINE_ void _get_theme_type_dependencies(const StringName &p_theme_type, List<StringName> *p_list) const;
+
+ void _theme_changed();
+ void _invalidate_theme_cache();
+
Viewport *embedder = nullptr;
friend class Viewport; //friend back, can call the methods below
@@ -158,6 +170,8 @@ protected:
Viewport *_get_embedder() const;
virtual Rect2i _popup_adjust_rect() const { return Rect2i(); }
+ virtual void _update_theme_item_cache();
+
virtual void _post_popup() {}
virtual Size2 _get_contents_minimum_size() const;
static void _bind_methods();
@@ -259,11 +273,9 @@ public:
void set_theme(const Ref<Theme> &p_theme);
Ref<Theme> get_theme() const;
- void _theme_changed();
void set_theme_type_variation(const StringName &p_theme_type);
StringName get_theme_type_variation() const;
- _FORCE_INLINE_ void _get_theme_type_dependencies(const StringName &p_theme_type, List<StringName> *p_list) const;
Size2 get_contents_minimum_size() const;