X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fengineer%2Ftraindialog.cpp;h=6aa469a37bc7edc85403c694c2b321f9c2e51186;hb=9e96d36a21c24befc88c7bf9c1014c22169e3a6a;hp=432f3dd22c99b98f7ea8d212b2dfeb73db861b9c;hpb=1e7b81e843b584381ed779996b3e7a20f3ec19ce;p=r2c2.git diff --git a/source/engineer/traindialog.cpp b/source/engineer/traindialog.cpp index 432f3dd..6aa469a 100644 --- a/source/engineer/traindialog.cpp +++ b/source/engineer/traindialog.cpp @@ -134,8 +134,13 @@ void TrainDialog::ui_forward_toggled(bool value) void TrainDialog::expand_clicked() { - pnl_expander->set_visible(!pnl_expander->is_visible()); - btn_expand->set_style(pnl_expander->is_visible() ? "arrow_up" : "arrow_down"); + set_expanded(!pnl_expander->is_visible()); +} + +void TrainDialog::set_expanded(bool e) +{ + pnl_expander->set_visible(e); + btn_expand->set_style(e ? "arrow_up" : "arrow_down"); signal_autosize_changed.emit(); find_ancestor()->get_layout()->update(); }