]> git.tdb.fi Git - r2c2.git/blobdiff - source/engineer/traindialog.cpp
Use a GLtk::Layout with FloatingArrangement to manage dialogs
[r2c2.git] / source / engineer / traindialog.cpp
index 350fbf063f81f6fcf76761001eb35f7fc63b7afc..54dac6a84af53c2e69b9ab5896351d32d73eafe0 100644 (file)
@@ -1,6 +1,7 @@
 #include <msp/core/maputils.h>
 #include <msp/core/raii.h>
 #include <msp/gltk/part.h>
+#include <msp/gltk/root.h>
 #include <msp/gltk/stack.h>
 #include <msp/strings/format.h>
 #include "libr2c2/aicontrol.h"
@@ -126,11 +127,8 @@ void TrainDialog::expand_clicked()
 {
        pnl_expander->set_visible(!pnl_expander->is_visible());
        btn_expand->set_style(pnl_expander->is_visible() ? "arrow_up" : "arrow_down");
-       GLtk::Geometry ageom = geom;
-       ageom.h = 0;
-       layout->autosize(ageom);
-       ageom.y = geom.y+geom.h-ageom.h;
-       set_geometry(ageom);
+       signal_autosize_changed.emit();
+       find_ancestor<GLtk::Root>()->get_layout()->update();
 }
 
 void TrainDialog::toggle_panel(bool show, GLtk::Panel *panel)