summaryrefslogtreecommitdiff
path: root/scene/gui/panel.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-09-01 19:08:02 +0200
committerGitHub <noreply@github.com>2022-09-01 19:08:02 +0200
commitdcd74563b64fb45323c5d99e1382125488b863e8 (patch)
treeaffdf2682e07d9345e1a7a516dcf05c00417cee0 /scene/gui/panel.cpp
parentf02134a8c0452a2c9fb60f9d0260e5f1ee3e252d (diff)
parent3b1aa240dc2415c454062e769d4edcc81544e1f8 (diff)
Merge pull request #65156 from YuriSizov/control-customizable-cache-p1
Diffstat (limited to 'scene/gui/panel.cpp')
-rw-r--r--scene/gui/panel.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/scene/gui/panel.cpp b/scene/gui/panel.cpp
index 1ac6cf57ab..09bc295513 100644
--- a/scene/gui/panel.cpp
+++ b/scene/gui/panel.cpp
@@ -30,12 +30,17 @@
#include "panel.h"
+void Panel::_update_theme_item_cache() {
+ Control::_update_theme_item_cache();
+
+ theme_cache.panel_style = get_theme_stylebox(SNAME("panel"));
+}
+
void Panel::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_DRAW: {
RID ci = get_canvas_item();
- Ref<StyleBox> style = get_theme_stylebox(SNAME("panel"));
- style->draw(ci, Rect2(Point2(), get_size()));
+ theme_cache.panel_style->draw(ci, Rect2(Point2(), get_size()));
} break;
}
}