diff options
Diffstat (limited to 'scene/gui/progress_bar.h')
-rw-r--r-- | scene/gui/progress_bar.h | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/scene/gui/progress_bar.h b/scene/gui/progress_bar.h index 2d89163f78..b6d7d2c7cf 100644 --- a/scene/gui/progress_bar.h +++ b/scene/gui/progress_bar.h @@ -36,18 +36,47 @@ class ProgressBar : public Range { GDCLASS(ProgressBar, Range); - bool percent_visible = true; + bool show_percentage = true; + + struct ThemeCache { + Ref<StyleBox> background_style; + Ref<StyleBox> fill_style; + + Ref<Font> font; + int font_size = 0; + Color font_color; + int font_outline_size = 0; + Color font_outline_color; + } theme_cache; protected: + virtual void _update_theme_item_cache() override; + void _notification(int p_what); static void _bind_methods(); public: - void set_percent_visible(bool p_visible); - bool is_percent_visible() const; + enum FillMode { + FILL_BEGIN_TO_END, + FILL_END_TO_BEGIN, + FILL_TOP_TO_BOTTOM, + FILL_BOTTOM_TO_TOP, + FILL_MODE_MAX + }; + + void set_fill_mode(int p_fill); + int get_fill_mode(); + + void set_show_percentage(bool p_visible); + bool is_percentage_shown() const; Size2 get_minimum_size() const override; ProgressBar(); + +private: + FillMode mode = FILL_BEGIN_TO_END; }; +VARIANT_ENUM_CAST(ProgressBar::FillMode); + #endif // PROGRESS_BAR_H |