]> git.tdb.fi Git - libs/gltk.git/commitdiff
Remove unnecessary Container::create_child
authorMikko Rasa <tdb@tdb.fi>
Mon, 21 Aug 2023 09:34:21 +0000 (12:34 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 21 Aug 2023 12:51:08 +0000 (15:51 +0300)
Overriding the child type has been obsolete since 1b29f19.

source/container.cpp
source/container.h
source/panel.cpp

index a8c3133d0632238831c5b1692f29c2e9c32c3876..5c175031d76515e8b2bd2c269bdd9806baeb39bc 100644 (file)
@@ -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();
index 40fe4dc60d4855e44a890af8a4230b9ab764c3b7..45985bc0ad585c304d5735f2ad037b016bbdc53b 100644 (file)
@@ -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;
index 31cdf4b4ff9e62fa306fa0848c0879046e79aa56..5c189e0003429b29835efd9a687b97ffe1eb9f06 100644 (file)
@@ -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);
        }