]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/panel.cpp
Add protected functions for manipulating widget state
[libs/gltk.git] / source / panel.cpp
index a086a4e443f6fbebc779e570e9b29500063bbd03..91e30cdcbafadd63b98714c6cd1a8f3969fb1f07 100644 (file)
@@ -39,6 +39,12 @@ void Panel::set_layout(Layout *l)
        layout = l;
 }
 
+void Panel::autosize()
+{
+       if(layout)
+               layout->autosize();
+}
+
 Panel::Child *Panel::create_child(Widget *wdg)
 {
        return new Child(*this, wdg);
@@ -151,16 +157,28 @@ void Panel::focus_out()
        Widget::focus_out();
 }
 
+void Panel::on_geometry_change()
+{
+       if(layout)
+               layout->update();
+}
+
 void Panel::on_child_added(Widget &wdg)
 {
        if(layout)
+       {
                layout->add_widget(wdg);
+               signal_autosize_changed.emit();
+       }
 }
 
 void Panel::on_child_removed(Widget &wdg)
 {
        if(layout)
+       {
                layout->remove_widget(wdg);
+               signal_autosize_changed.emit();
+       }
 }
 
 void Panel::set_pointer_focus(Widget *wdg)