mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 23:17:35 -06:00
Remember the sidebar size (#3700)
Store the current sidebar size using `best_size`
This commit is contained in:
parent
44ad091bf0
commit
418aca7186
1 changed files with 9 additions and 0 deletions
|
@ -2646,6 +2646,15 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
||||||
sidebar_layout.is_collapsed = !sidebar.IsShown();
|
sidebar_layout.is_collapsed = !sidebar.IsShown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Keep tracking the current sidebar size, by storing it using `best_size`, which will be stored
|
||||||
|
// in the config and re-applied when the app is opened again.
|
||||||
|
this->sidebar->Bind(wxEVT_IDLE, [&sidebar, this](wxIdleEvent& e) {
|
||||||
|
if (sidebar.IsShown() && sidebar.IsDocked() && sidebar.rect.GetWidth() > 0) {
|
||||||
|
sidebar.BestSize(sidebar.rect.GetWidth(), sidebar.best_size.GetHeight());
|
||||||
|
}
|
||||||
|
e.Skip();
|
||||||
|
});
|
||||||
|
|
||||||
// Hide sidebar initially, will re-show it after initialization when we got proper window size
|
// Hide sidebar initially, will re-show it after initialization when we got proper window size
|
||||||
sidebar.Hide();
|
sidebar.Hide();
|
||||||
m_aui_mgr.Update();
|
m_aui_mgr.Update();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue