mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-25 20:02:17 +00:00
FIX: something
Change-Id: I2923786337f97f4297b0444522c620891aa2ad90 Jira: STUDIO-9725 filament menu delete icon Jira: STUDIO-9785 StaticGroup border color Jira: STUDIO-9716 update badge icon Jira: STUDIO-9815 click printer/bed panel for combobox Jira: STUDIO-9867 label with for single noozle Jira: STUDIO-9739 ams page up/down (cherry picked from commit 1cde0b844a97f3420db4999927f05a833b92b0fb)
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
StaticGroup::StaticGroup(wxWindow *parent, wxWindowID id, const wxString &label)
|
||||
: wxStaticBox(parent, id, label)
|
||||
{
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
SetForegroundColour("#CECECE");
|
||||
#ifdef __WXMSW__
|
||||
Bind(wxEVT_PAINT, &StaticGroup::OnPaint, this);
|
||||
#else
|
||||
@@ -30,4 +32,29 @@ void StaticGroup::OnPaint(wxPaintEvent &evt)
|
||||
}
|
||||
}
|
||||
|
||||
void StaticGroup::PaintForeground(wxDC &dc, const struct tagRECT &rc)
|
||||
{
|
||||
wxStaticBox::PaintForeground(dc, rc);
|
||||
auto mdc = dynamic_cast<wxMemoryDC *>(&dc);
|
||||
auto image = mdc->GetSelectedBitmap().ConvertToImage();
|
||||
// Found border coords
|
||||
int top = 0;
|
||||
int left = 0;
|
||||
int right = rc.right - 1;
|
||||
int bottom = rc.bottom - 1;
|
||||
auto blue = GetBackgroundColour().Blue();
|
||||
while (image.GetBlue(0, top) == blue) ++top;
|
||||
while (image.GetBlue(left, top) != blue) ++left; // --left; // fix start
|
||||
while (image.GetBlue(right, top) != blue) --right; ++right;
|
||||
while (image.GetBlue(0, bottom) == blue) --bottom;
|
||||
// Draw border with foreground color
|
||||
wxPoint polygon[] = { {left, top}, {0, top}, {0, bottom}, {rc.right - 1, bottom}, {rc.right - 1, top}, {right, top} };
|
||||
dc.SetPen(wxPen(GetForegroundColour(), 1));
|
||||
for (int i = 1; i < 6; ++i) {
|
||||
if (i == 4) // fix bottom right corner
|
||||
++polygon[i - 1].y;
|
||||
dc.DrawLine(polygon[i - 1], polygon[i]);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user