From eeec8c83778e73c02c414db772f790540e626d2c Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 21 Aug 2023 12:34:21 +0300 Subject: [PATCH] Remove unnecessary Container::create_child Overriding the child type has been obsolete since 1b29f19. --- source/container.cpp | 7 +------ source/container.h | 1 - source/panel.cpp | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/source/container.cpp b/source/container.cpp index a8c3133..5c17503 100644 --- a/source/container.cpp +++ b/source/container.cpp @@ -21,7 +21,7 @@ Container::~Container() void Container::add(Widget &wdg) { wdg.set_parent(this); - children.push_back(create_child(&wdg)); + children.push_back(new Child(*this, &wdg)); if(wdg.get_animation_interval()) check_animation_interval(); children_rebuild_needed = true; @@ -45,11 +45,6 @@ void Container::remove(Widget &wdg) on_child_removed(wdg); } -Container::Child *Container::create_child(Widget *wdg) -{ - return new Child(*this, wdg); -} - Geometry Container::determine_child_geometry(const Widget &child, const Part &part) const { Geometry pgeom = part.get_geometry(); diff --git a/source/container.h b/source/container.h index 40fe4dc..45985bc 100644 --- a/source/container.h +++ b/source/container.h @@ -54,7 +54,6 @@ public: void add(Widget &); void remove(Widget &); protected: - virtual Child *create_child(Widget *); Geometry determine_child_geometry(const Widget &, const Part &) const; void autosize_child(const Widget &, const Part &, Geometry &) const; void reposition_child(Widget &, const Part &) const; diff --git a/source/panel.cpp b/source/panel.cpp index 31cdf4b..5c189e0 100644 --- a/source/panel.cpp +++ b/source/panel.cpp @@ -55,7 +55,7 @@ void Panel::render_special(const Part &part, GL::Renderer &renderer) const { if(part.get_name()=="children") { - for(const Container::Child *c: children) + for(const Child *c: children) if(c->widget->is_visible()) c->widget->render(renderer); } -- 2.45.2