Handle high resolution displays in wxBitmapButtonBase::NewCloseButton().
Bitmap for the close button is scaled based on GetContentScaleFactor(). On OS X the resulting bitmap has to use the correct scaling factor in order to be displayed correctly on the button when using a high resolution display.
This commit is contained in:
@@ -103,12 +103,13 @@ GetCloseButtonBitmap(wxWindow *win,
|
|||||||
const wxColour& colBg,
|
const wxColour& colBg,
|
||||||
int flags = 0)
|
int flags = 0)
|
||||||
{
|
{
|
||||||
wxBitmap bmp(size);
|
wxBitmap bmp;
|
||||||
|
bmp.CreateScaled(size.x, size.y, wxBITMAP_SCREEN_DEPTH, win->GetContentScaleFactor());
|
||||||
wxMemoryDC dc(bmp);
|
wxMemoryDC dc(bmp);
|
||||||
dc.SetBackground(colBg);
|
dc.SetBackground(colBg);
|
||||||
dc.Clear();
|
dc.Clear();
|
||||||
wxRendererNative::Get().
|
wxRendererNative::Get().
|
||||||
DrawTitleBarBitmap(win, dc, size, wxTITLEBAR_BUTTON_CLOSE, flags);
|
DrawTitleBarBitmap(win, dc, win->FromDIP(size), wxTITLEBAR_BUTTON_CLOSE, flags);
|
||||||
return bmp;
|
return bmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user