centre frame decoration bitmaps in their buttons
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41334 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1383,22 +1383,23 @@ void wxStdRenderer::DrawFrameButton(wxDC& dc,
|
||||
if ( !bmp.Ok() )
|
||||
return;
|
||||
|
||||
wxRect r(x, y, FRAME_BUTTON_WIDTH, FRAME_BUTTON_HEIGHT);
|
||||
wxRect rectBtn(x, y, FRAME_BUTTON_WIDTH, FRAME_BUTTON_HEIGHT);
|
||||
if ( flags & wxCONTROL_PRESSED )
|
||||
{
|
||||
DrawSunkenBorder(dc, &r);
|
||||
DrawSunkenBorder(dc, &rectBtn);
|
||||
|
||||
r.x++;
|
||||
r.y++;
|
||||
rectBtn.x++;
|
||||
rectBtn.y++;
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawRaisedBorder(dc, &r);
|
||||
DrawRaisedBorder(dc, &rectBtn);
|
||||
}
|
||||
|
||||
DrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL), r);
|
||||
DrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL), rectBtn);
|
||||
|
||||
dc.DrawBitmap(bmp, r.x, r.y, true);
|
||||
wxRect rectBmp(0, 0, bmp.GetWidth(), bmp.GetHeight());
|
||||
dc.DrawBitmap(bmp, rectBmp.CentreIn(rectBtn).GetPosition(), true);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user