mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-02 05:40:39 +08:00
DropDown: OSX specific: Fixed rendering of selected item
This commit is contained in:
parent
e7d6f63232
commit
7553bbe12d
@ -291,9 +291,11 @@ void DropDown::render(wxDC &dc)
|
|||||||
// if (GetWindowStyle() & wxBORDER_NONE)
|
// if (GetWindowStyle() & wxBORDER_NONE)
|
||||||
// dc.SetPen(wxNullPen);
|
// dc.SetPen(wxNullPen);
|
||||||
|
|
||||||
|
const bool is_retina = wxOSX && dc.GetContentScaleFactor() > 1.0;
|
||||||
|
|
||||||
wxRect rc(0, 0, size.x, size.y);
|
wxRect rc(0, 0, size.x, size.y);
|
||||||
if (wxOSX && dc.GetContentScaleFactor() > 1.0)
|
// On Retina displays all controls are cut on 1px
|
||||||
// On Retina displays all controls are cut on 1px
|
if (is_retina)
|
||||||
rc.x = rc.y = 1;
|
rc.x = rc.y = 1;
|
||||||
|
|
||||||
// draw background
|
// draw background
|
||||||
@ -329,8 +331,12 @@ void DropDown::render(wxDC &dc)
|
|||||||
dc.SetBrush(wxBrush(selector_background_color.colorForStates(StateColor::Disabled)));
|
dc.SetBrush(wxBrush(selector_background_color.colorForStates(StateColor::Disabled)));
|
||||||
dc.SetPen(wxPen(selector_background_color.colorForStates(states)));
|
dc.SetPen(wxPen(selector_background_color.colorForStates(states)));
|
||||||
rcContent.Deflate(4, 1);
|
rcContent.Deflate(4, 1);
|
||||||
|
if (is_retina)
|
||||||
|
rc.y += 1;
|
||||||
dc.DrawRectangle(rcContent);
|
dc.DrawRectangle(rcContent);
|
||||||
rcContent.Inflate(4, 1);
|
rcContent.Inflate(4, 1);
|
||||||
|
if (is_retina)
|
||||||
|
rc.y -= 1;
|
||||||
}
|
}
|
||||||
rcContent.y = offset.y;
|
rcContent.y = offset.y;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user