Mon, 25 Oct 2021 06:58:50 +0300
* Small fixes to previous changes
--- a/Source/Gorgon/UI/Widget.cpp Sun Oct 24 19:07:17 2021 +0300 +++ b/Source/Gorgon/UI/Widget.cpp Mon Oct 25 06:58:50 2021 +0300 @@ -191,4 +191,35 @@ )); } + + void Widget::parentboundschanged() { + //for now + + //move out + int unitsize = 0, spacing = 0; + Geometry::Size sz; + if(HasParent()) { + unitsize = GetParent().GetUnitSize(); + spacing = GetParent().GetSpacing(); + sz = GetParent().GetInteriorSize(); + } + else { + unitsize = Widgets::Registry::Active().GetUnitSize(); + spacing = Widgets::Registry::Active().GetSpacing(); + sz = GetCurrentSize(); + } + + move(Convert( + location, sz, + unitsize, spacing, + Widgets::Registry::Active().GetEmSize() + )); + + resize(Convert( + size, sz, + unitsize, spacing, + Widgets::Registry::Active().GetEmSize() + )); + } + } }
--- a/Source/Gorgon/UI/Widget.h Sun Oct 24 19:07:17 2021 +0300 +++ b/Source/Gorgon/UI/Widget.h Mon Oct 25 06:58:50 2021 +0300 @@ -285,7 +285,7 @@ virtual void boundschanged(); /// Call this function when the bounds of the parent is changed - virtual void parentboundschanged() { } + virtual void parentboundschanged(); /// This function is called when the parent's enabled state changes. virtual void parentenabledchanged(bool /*state*/) { }
--- a/Source/Gorgon/Widgets/GeometryBoxes.h Sun Oct 24 19:07:17 2021 +0300 +++ b/Source/Gorgon/Widgets/GeometryBoxes.h Mon Oct 25 06:58:50 2021 +0300 @@ -83,7 +83,9 @@ public: using Inputbox::operator=; - using Widget::Move; + using Widget::Resize; + using Widget::SetWidth; + using Widget::SetHeight; /// Initializes the inputbox @@ -115,7 +117,10 @@ public: using Inputbox::operator=; - using Widget::Move; + using Widget::Resize; + using Widget::SetWidth; + using Widget::SetHeight; + /// Initializes the inputbox @@ -148,6 +153,12 @@ public: using Inputbox::operator=; + using Widget::Move; + using Widget::Resize; + using Widget::SetWidth; + using Widget::SetHeight; + + /// Initializes the inputbox explicit Boundsbox(const UI::Template &temp, Geometry::Bounds value = {0, 0, 0, 0}) : Inputbox(temp, value) { } @@ -178,6 +189,11 @@ public: using Inputbox::operator=; + using Widget::Move; + using Widget::Resize; + using Widget::SetWidth; + using Widget::SetHeight; + /// Initializes the inputbox explicit Marginbox(const UI::Template &temp, Geometry::Margin value = {0, 0, 0, 0}) : Inputbox(temp, value) { }