mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
ENH: add badge for StaticBox and StaticGroup
Change-Id: I8b6e7938de524102809784b078de337da789cde8 Jira: STUDIO-8858 (cherry picked from commit 9733ef0144aebb0c6e711b7d56c36a3d187f628a)
This commit is contained in:
@@ -22,7 +22,7 @@ StaticBox::StaticBox()
|
||||
, radius(8)
|
||||
{
|
||||
border_color = StateColor(
|
||||
std::make_pair(0xF0F0F1, (int) StateColor::Disabled),
|
||||
std::make_pair(0xF0F0F1, (int) StateColor::Disabled),
|
||||
std::make_pair(0x303A3C, (int) StateColor::Normal));
|
||||
}
|
||||
|
||||
@@ -110,6 +110,15 @@ wxColor StaticBox::GetParentBackgroundColor(wxWindow* parent)
|
||||
return *wxWHITE;
|
||||
}
|
||||
|
||||
void StaticBox::ShowBadge(bool show)
|
||||
{
|
||||
if (show)
|
||||
badge = ScalableBitmap(this, "badge", 18);
|
||||
else
|
||||
badge = ScalableBitmap {};
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void StaticBox::eraseEvent(wxEraseEvent& evt)
|
||||
{
|
||||
// for transparent background, but not work
|
||||
@@ -218,4 +227,9 @@ void StaticBox::doRender(wxDC& dc)
|
||||
lb += db; while (lb >= size.y) { ++b, lb -= size.y; } while (lb <= -size.y) { --b, lb += size.y; }
|
||||
}
|
||||
}
|
||||
|
||||
if (badge.bmp().IsOk()) {
|
||||
auto s = badge.bmp().GetScaledSize();
|
||||
dc.DrawBitmap(badge.bmp(), size.x - s.x, 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user