mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-10 03:27:35 +00:00
Change-Id: I8b6e7938de524102809784b078de337da789cde8 Jira: STUDIO-8858 (cherry picked from commit 9733ef0144aebb0c6e711b7d56c36a3d187f628a)
34 lines
674 B
C++
34 lines
674 B
C++
#include "StaticGroup.hpp"
|
|
|
|
StaticGroup::StaticGroup(wxWindow *parent, wxWindowID id, const wxString &label)
|
|
: wxStaticBox(parent, id, label)
|
|
{
|
|
#ifdef __WXMSW__
|
|
Bind(wxEVT_PAINT, &StaticGroup::OnPaint, this);
|
|
#else
|
|
#endif
|
|
}
|
|
|
|
void StaticGroup::ShowBadge(bool show)
|
|
{
|
|
if (show)
|
|
badge = ScalableBitmap(this, "badge", 18);
|
|
else
|
|
badge = ScalableBitmap{};
|
|
Refresh();
|
|
}
|
|
|
|
#ifdef __WXMSW__
|
|
|
|
void StaticGroup::OnPaint(wxPaintEvent &evt)
|
|
{
|
|
wxStaticBox::OnPaint(evt);
|
|
if (badge.bmp().IsOk()) {
|
|
auto s = badge.bmp().GetScaledSize();
|
|
wxPaintDC dc(this);
|
|
dc.DrawBitmap(badge.bmp(), GetSize().x - s.x, 8);
|
|
}
|
|
}
|
|
|
|
#endif
|