diff --git a/include/Cubed/ui/button.hpp b/include/Cubed/ui/button.hpp index ec2a570..1d8b306 100644 --- a/include/Cubed/ui/button.hpp +++ b/include/Cubed/ui/button.hpp @@ -23,8 +23,8 @@ public: float width() const override; float height() const override; - Button& set_width(float width); - Button& set_height(float height); + Button& set_width(float width) override; + Button& set_height(float height) override; Button& set_background_image(const std::string& path, TextureManager& texture_manager); Button& set_default_image(TextureManager& texture_manager); @@ -54,8 +54,6 @@ private: "texture/ui/button001.png"; std::function m_clicked; - float m_width = NORMAL_BUTTON_WIDTH; - float m_height = NORMAL_BUTTON_HEIGHT; float m_scale = DEFAULT_SCALE; bool m_auto_scale = false; void on_render(Renderer& renderer) override; diff --git a/include/Cubed/ui/chat_box.hpp b/include/Cubed/ui/chat_box.hpp index 1fef375..f074341 100644 --- a/include/Cubed/ui/chat_box.hpp +++ b/include/Cubed/ui/chat_box.hpp @@ -17,7 +17,6 @@ public: ChatBox& set_text_scale(float scale); // Only the width of TextField can be set; the height is calculated // dynamically - ChatBox& set_width(float width); ChatBox& set_show_lines(int lines); ChatBox& set_spacing(float spacing); ChatBox& clear_input(); @@ -42,8 +41,6 @@ private: int m_lines = 10; bool m_scale = 1.0f; float m_spacing = 0.0f; - float m_width = 0.0f; - float m_height = 0.0f; float m_text_scale = 1.0f; std::deque m_messages; std::unique_ptr m_text_field; diff --git a/include/Cubed/ui/column_layout.hpp b/include/Cubed/ui/column_layout.hpp index e687897..5874e79 100644 --- a/include/Cubed/ui/column_layout.hpp +++ b/include/Cubed/ui/column_layout.hpp @@ -26,8 +26,8 @@ public: private: int m_spacing = 0; - float m_content_height = 0; - float m_content_width = 0; + float m_content_height = 0.0f; + float m_content_width = 0.0f; ColumnLayoutAnchor m_layout_anchor = ColumnLayoutAnchor::CENTER; }; } // namespace Cubed \ No newline at end of file diff --git a/include/Cubed/ui/image.hpp b/include/Cubed/ui/image.hpp index 81a392d..967caab 100644 --- a/include/Cubed/ui/image.hpp +++ b/include/Cubed/ui/image.hpp @@ -21,17 +21,9 @@ public: Image& set_scale(float scale); float scale() const; - Image& set_height(float height); - Image& set_width(float width); - - Image& set_fill(bool fill); - private: void on_render(Renderer& renderer) override; void on_update(float dt) override; - float m_width = 0.0f; - float m_height = 0.0f; - bool m_fill = false; const Texture* m_texture = nullptr; glm::vec2 m_pos{0.0f, 0.0f}; diff --git a/include/Cubed/ui/rect.hpp b/include/Cubed/ui/rect.hpp index ef25703..3a0c3ae 100644 --- a/include/Cubed/ui/rect.hpp +++ b/include/Cubed/ui/rect.hpp @@ -16,11 +16,6 @@ public: float height() const override; float alpha() const; - Rect& set_width(float width); - Rect& set_height(float height); - - Rect& set_fill(bool fill); - Rect& set_scale(float scale); Rect& set_color(Color color); Rect& set_alpha(float alpha); @@ -32,10 +27,7 @@ private: void on_render(Renderer& renderer) override; Color m_color = Color::WHITE; - float m_width = 0.0f; - float m_height = 0.0f; float m_scale = 1.0f; float m_alpha = 1.0f; - bool m_fill = false; }; } // namespace Cubed \ No newline at end of file diff --git a/include/Cubed/ui/slider.hpp b/include/Cubed/ui/slider.hpp index fe77ff4..131a16b 100644 --- a/include/Cubed/ui/slider.hpp +++ b/include/Cubed/ui/slider.hpp @@ -21,8 +21,8 @@ public: float height() const override; Slider& set_scale(float scale); - Slider& set_width(float width); - Slider& set_height(float h); + Slider& set_width(float width) override; + Slider& set_height(float h) override; Slider& set_slider_text(const std::string& key, const std::string& variable); Slider& set_track_image(const std::string& path, @@ -48,8 +48,7 @@ private: std::unique_ptr