diff --git a/include/uui/component.hpp b/include/uui/component.hpp index 7bd2c39..a9ad0bb 100644 --- a/include/uui/component.hpp +++ b/include/uui/component.hpp @@ -22,8 +22,8 @@ protected: uui::position_t position_x; uui::position_t position_y; - uui::position_t size_width; - uui::position_t size_height; + uui::size_t size_width; + uui::size_t size_height; bool coord_all_relative; diff --git a/include/uui/opengl/component.hpp b/include/uui/opengl/component.hpp index 24230df..441e322 100644 --- a/include/uui/opengl/component.hpp +++ b/include/uui/opengl/component.hpp @@ -34,13 +34,9 @@ protected: GlComponent( std::shared_ptr window, std::size_t window_index, std::shared_ptr parent, - std::size_t parent_index, const position_t x, const position_t y, const position_t width, - const position_t height); - GlComponent( - std::shared_ptr window, std::size_t window_index, const position_t x, const position_t y, - const position_t width, const position_t height): - GlComponent( - window, window_index, std::static_pointer_cast(window), window_index, x, y, width, height) + std::size_t parent_index, const ComponentParams& params); + GlComponent(std::shared_ptr window, std::size_t window_index, const ComponentParams& params): + GlComponent(window, window_index, std::static_pointer_cast(window), window_index, params) {} GlComponent(const GlComponent&) = delete; GlComponent(GlComponent&&) = default; diff --git a/include/uui/opengl/flex.hpp b/include/uui/opengl/flex.hpp index b73fac3..e0bcdc5 100644 --- a/include/uui/opengl/flex.hpp +++ b/include/uui/opengl/flex.hpp @@ -18,11 +18,9 @@ class GlFlex: virtual public GlStack, virtual public Flex protected: GlFlex( std::shared_ptr window, std::size_t window_index, std::shared_ptr parent, - std::size_t parent_index, const position_t x, const position_t y, const Direction direction); - GlFlex( - std::shared_ptr window, std::size_t window_index, const position_t x, const position_t y, - const Direction direction): - GlFlex(window, window_index, window, window_index, x, y, direction) + std::size_t parent_index, const StackParams& params); + GlFlex(std::shared_ptr window, std::size_t window_index, const StackParams& params): + GlFlex(window, window_index, window, window_index, params) {} std::tuple get_child_position(const std::size_t child_index) const override; diff --git a/include/uui/opengl/label.hpp b/include/uui/opengl/label.hpp index bbcb296..4570717 100644 --- a/include/uui/opengl/label.hpp +++ b/include/uui/opengl/label.hpp @@ -26,12 +26,9 @@ protected: GlLabel( std::shared_ptr window, std::size_t window_index, std::shared_ptr parent, - std::size_t parent_index, const position_t x, const position_t y, const std::string& text, - const std::tuple& text_color); - GlLabel( - std::shared_ptr window, std::size_t window_index, const position_t x, const position_t y, - const std::string& text, const std::tuple& text_color): - GlLabel(window, window_index, window, window_index, x, y, text, text_color) + std::size_t parent_index, const LabelParams& params); + GlLabel(std::shared_ptr window, std::size_t window_index, const LabelParams& params): + GlLabel(window, window_index, window, window_index, params) {} void render() final; diff --git a/include/uui/opengl/stack.hpp b/include/uui/opengl/stack.hpp index 97d58de..b625314 100644 --- a/include/uui/opengl/stack.hpp +++ b/include/uui/opengl/stack.hpp @@ -15,19 +15,15 @@ class GlStack: virtual public GlComponent, virtual public GlContainer, virtual p friend class GlWindow; public: - void create_component(const position_t width, const position_t height, InitFunction init) override; - void create_label( - const std::string& text, const std::tuple& text_color, - InitFunction