mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Try to fix compilation bug
This commit is contained in:
parent
04dc50cec4
commit
bb27d62ba8
2 changed files with 67 additions and 63 deletions
|
@ -144,10 +144,6 @@ PrusaCollapsiblePane *m_collpane_settings = nullptr;
|
|||
|
||||
wxFont g_small_font { wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT) };
|
||||
wxFont g_bold_font { wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).Bold() };
|
||||
#ifdef __WXMAC__
|
||||
g_small_font.SetPointSize(11);
|
||||
g_bold_font.SetPointSize(11);
|
||||
#endif /*__WXMAC__*/
|
||||
|
||||
static void init_label_colours()
|
||||
{
|
||||
|
@ -177,10 +173,19 @@ void update_label_colours_from_appconfig()
|
|||
}
|
||||
}
|
||||
|
||||
static void init_fonts()
|
||||
{
|
||||
#ifdef __WXMAC__
|
||||
g_small_font.SetPointSize(11);
|
||||
g_bold_font.SetPointSize(11);
|
||||
#endif /*__WXMAC__*/
|
||||
}
|
||||
|
||||
void set_wxapp(wxApp *app)
|
||||
{
|
||||
g_wxApp = app;
|
||||
init_label_colours();
|
||||
init_fonts();
|
||||
}
|
||||
|
||||
void set_main_frame(wxFrame *main_frame)
|
||||
|
|
|
@ -257,63 +257,6 @@ 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
|
||||
if (IsCollapsed() == collapse)
|
||||
return;
|
||||
|
||||
InvalidateBestSize();
|
||||
|
||||
// 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());
|
||||
}
|
||||
|
||||
void PrusaCollapsiblePane::SetLabel(const wxString &label)
|
||||
{
|
||||
m_strLabel = label;
|
||||
|
@ -347,6 +290,62 @@ bool PrusaCollapsiblePane::Layout()
|
|||
}
|
||||
#endif //__WXMSW__
|
||||
|
||||
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
|
||||
if (IsCollapsed() == collapse)
|
||||
return;
|
||||
|
||||
InvalidateBestSize();
|
||||
|
||||
// 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());
|
||||
}
|
||||
|
||||
// *****************************************************************************
|
||||
// ----------------------------------------------------------------------------
|
||||
// MyObjectTreeModel
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue