summaryrefslogtreecommitdiff
path: root/scene/gui/option_button.h
diff options
context:
space:
mode:
authorYuri Sizov <yuris@humnom.net>2022-08-31 15:02:40 +0300
committerYuri Sizov <yuris@humnom.net>2022-09-01 16:35:36 +0300
commit3b1aa240dc2415c454062e769d4edcc81544e1f8 (patch)
treee66119340a0b02cc975416290be914237ae4ee4b /scene/gui/option_button.h
parent0c221f0284909a1156a1c98de5104e07c1cce0b9 (diff)
Add a lifecycle method for manual theme item caching to Control
Diffstat (limited to 'scene/gui/option_button.h')
-rw-r--r--scene/gui/option_button.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/scene/gui/option_button.h b/scene/gui/option_button.h
index cd709b8f5f..2c7e0510f5 100644
--- a/scene/gui/option_button.h
+++ b/scene/gui/option_button.h
@@ -43,6 +43,23 @@ class OptionButton : public Button {
Vector2 _cached_size;
bool cache_refresh_pending = false;
+ struct ThemeCache {
+ Ref<StyleBox> normal;
+
+ Color font_color;
+ Color font_focus_color;
+ Color font_pressed_color;
+ Color font_hover_color;
+ Color font_hover_pressed_color;
+ Color font_disabled_color;
+
+ int h_separation = 0;
+
+ Ref<Texture2D> arrow_icon;
+ int arrow_margin = 0;
+ int modulate_arrow = 0;
+ } theme_cache;
+
void _focused(int p_which);
void _selected(int p_which);
void _select(int p_which, bool p_emit = false);
@@ -54,6 +71,7 @@ class OptionButton : public Button {
protected:
Size2 get_minimum_size() const override;
+ virtual void _update_theme_item_cache() override;
void _notification(int p_what);
bool _set(const StringName &p_name, const Variant &p_value);
bool _get(const StringName &p_name, Variant &r_ret) const;