Tried to improve look of toogle tool under OS X, adapted from #10346: Nicer drawing of pseudo-toggle toolbar button on OS X

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57933 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2009-01-09 10:31:43 +00:00
parent 1ed06824c8
commit f656d37923

View File

@@ -501,16 +501,20 @@ void wxToolBarTool::UpdateToggleImage( bool toggle )
{
if ( toggle )
{
int w = m_bmpNormal.GetWidth();
int h = m_bmpNormal.GetHeight();
int w = m_bmpNormal.GetWidth() + 6;
int h = m_bmpNormal.GetHeight() + 6;
wxBitmap bmp( w, h );
wxMemoryDC dc;
dc.SelectObject( bmp );
dc.SetPen( wxPen(*wxBLACK) );
dc.SetBrush( wxBrush( *wxLIGHT_GREY ));
dc.DrawRectangle( 0, 0, w, h );
dc.DrawBitmap( m_bmpNormal, 0, 0, true );
wxColour mid_grey_75 = wxColour(128, 128, 128, 196);
wxColour light_grey_75 = wxColour(196, 196, 196, 196);
dc.GradientFillLinear( wxRect(1, 1, w - 1, h-1),
light_grey_75, mid_grey_75, wxNORTH);
wxColour black_50 = wxColour(0, 0, 0, 127);
dc.SetPen( wxPen(black_50) );
dc.DrawRoundedRectangle( 0, 0, w, h, 1.5 );
dc.DrawBitmap( m_bmpNormal, 3, 3, true );
dc.SelectObject( wxNullBitmap );
ControlButtonContentInfo info;
wxMacCreateBitmapButton( &info, bmp );