mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-23 20:22:04 +00:00
FIX: StaticGroup constriant layout badge on macOS
Change-Id: Ia93c91b990ec3f5fef3eae57d48ca71b4a0841e6 Jira: STUDIO-10383 (cherry picked from commit 88521a06d12cd4ebbcb8e98d8c929e9815aa71de)
This commit is contained in:
@@ -10,6 +10,8 @@ StaticGroup::StaticGroup(wxWindow *parent, wxWindowID id, const wxString &label)
|
||||
#endif
|
||||
}
|
||||
|
||||
void StaticGroup_layoutBadge(void * group, void * badge);
|
||||
|
||||
void StaticGroup::ShowBadge(bool show)
|
||||
{
|
||||
#ifdef __WXMSW__
|
||||
@@ -24,7 +26,7 @@ void StaticGroup::ShowBadge(bool show)
|
||||
badge = new ScalableButton(this, wxID_ANY, "badge", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, false, 18);
|
||||
badge->SetSize(badge->GetBestSize());
|
||||
badge->SetBackgroundColour("#F7F7F7");
|
||||
LayoutBadge();
|
||||
StaticGroup_layoutBadge(GetHandle(), badge->GetHandle());
|
||||
}
|
||||
if (badge && badge->IsShown() != show)
|
||||
badge->Show(show);
|
||||
@@ -69,22 +71,3 @@ void StaticGroup::PaintForeground(wxDC &dc, const struct tagRECT &rc)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __WXOSX__
|
||||
|
||||
void StaticGroup::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
{
|
||||
auto size = GetSize();
|
||||
wxStaticBox::DoSetSize(x, y, width, height, sizeFlags);
|
||||
if (badge && size != GetSize())
|
||||
LayoutBadge();
|
||||
}
|
||||
|
||||
void StaticGroup::LayoutBadge()
|
||||
{
|
||||
auto size = GetSize();
|
||||
auto size2 = size - badge->GetSize();
|
||||
badge->SetPosition({size2.x - 6, 0});
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user