mirror of
https://git.mirrors.martin98.com/https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-14 06:16:03 +08:00
Remember the sidebar size (#3700)
Store the current sidebar size using `best_size`
This commit is contained in:
parent
44ad091bf0
commit
418aca7186
@ -2646,6 +2646,15 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
||||
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
|
||||
sidebar.Hide();
|
||||
m_aui_mgr.Update();
|
||||
|
Loading…
x
Reference in New Issue
Block a user