mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 09:47:58 -06:00
Updated Collapsed/Layout for PrusaCollapsiblePane.
Cleaned right_panel
This commit is contained in:
parent
d7d0edf4dc
commit
c7d7da452e
4 changed files with 86 additions and 82 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue