mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +00:00
Updated Collapsed/Layout for PrusaCollapsiblePane.
Cleaned right_panel
This commit is contained in:
@@ -257,6 +257,36 @@ void PrusaCollapsiblePane::UpdateBtnBmp()
|
||||
Layout();
|
||||
}
|
||||
|
||||
void PrusaCollapsiblePane::OnStateChange_(const wxSize& sz)
|
||||
{
|
||||
SetSize(sz);
|
||||
|
||||
if (this->HasFlag(wxCP_NO_TLW_RESIZE))
|
||||
{
|
||||
// the user asked to explicitly handle the resizing itself...
|
||||
return;
|
||||
}
|
||||
|
||||
auto top = GetParent(); //right_panel
|
||||
if (!top)
|
||||
return;
|
||||
|
||||
wxSizer *sizer = top->GetSizer();
|
||||
if (!sizer)
|
||||
return;
|
||||
|
||||
const wxSize newBestSize = sizer->ComputeFittingClientSize(top);
|
||||
top->SetMinClientSize(newBestSize);
|
||||
|
||||
wxWindowUpdateLocker noUpdates_p(top->GetParent());
|
||||
// we shouldn't attempt to resize a maximized window, whatever happens
|
||||
// if (!top->IsMaximized())
|
||||
// top->SetClientSize(newBestSize);
|
||||
top->GetParent()->Layout();
|
||||
top->Refresh();
|
||||
}
|
||||
|
||||
|
||||
void PrusaCollapsiblePane::Collapse(bool collapse)
|
||||
{
|
||||
// optimization
|
||||
@@ -268,10 +298,20 @@ void PrusaCollapsiblePane::Collapse(bool collapse)
|
||||
// update our state
|
||||
m_pPane->Show(!collapse);
|
||||
|
||||
// update button label
|
||||
#if defined( __WXMAC__ ) && !defined(__WXUNIVERSAL__)
|
||||
m_pButton->SetOpen(!collapse);
|
||||
#else
|
||||
#ifdef __WXMSW__
|
||||
// update button bitmap
|
||||
UpdateBtnBmp();
|
||||
#else
|
||||
// NB: this must be done after updating our "state"
|
||||
m_pButton->SetLabel(GetBtnLabel());
|
||||
#endif //__WXMSW__
|
||||
#endif
|
||||
|
||||
OnStateChange(GetBestSize());
|
||||
OnStateChange_(GetBestSize());
|
||||
}
|
||||
|
||||
void PrusaCollapsiblePane::SetLabel(const wxString &label)
|
||||
|
||||
Reference in New Issue
Block a user