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:
@@ -501,16 +501,20 @@ void wxToolBarTool::UpdateToggleImage( bool toggle )
|
|||||||
{
|
{
|
||||||
if ( toggle )
|
if ( toggle )
|
||||||
{
|
{
|
||||||
int w = m_bmpNormal.GetWidth();
|
int w = m_bmpNormal.GetWidth() + 6;
|
||||||
int h = m_bmpNormal.GetHeight();
|
int h = m_bmpNormal.GetHeight() + 6;
|
||||||
wxBitmap bmp( w, h );
|
wxBitmap bmp( w, h );
|
||||||
wxMemoryDC dc;
|
wxMemoryDC dc;
|
||||||
|
|
||||||
dc.SelectObject( bmp );
|
dc.SelectObject( bmp );
|
||||||
dc.SetPen( wxPen(*wxBLACK) );
|
wxColour mid_grey_75 = wxColour(128, 128, 128, 196);
|
||||||
dc.SetBrush( wxBrush( *wxLIGHT_GREY ));
|
wxColour light_grey_75 = wxColour(196, 196, 196, 196);
|
||||||
dc.DrawRectangle( 0, 0, w, h );
|
dc.GradientFillLinear( wxRect(1, 1, w - 1, h-1),
|
||||||
dc.DrawBitmap( m_bmpNormal, 0, 0, true );
|
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 );
|
dc.SelectObject( wxNullBitmap );
|
||||||
ControlButtonContentInfo info;
|
ControlButtonContentInfo info;
|
||||||
wxMacCreateBitmapButton( &info, bmp );
|
wxMacCreateBitmapButton( &info, bmp );
|
||||||
|
Reference in New Issue
Block a user