X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/facd6764872eede45605ba7c9dfa0e1d0c708fa2..8b2858410444b111cb192d1539ef6c76209091fd:/src/mac/carbon/statbrma.cpp?ds=sidebyside diff --git a/src/mac/carbon/statbrma.cpp b/src/mac/carbon/statbrma.cpp index 8f3562c074..95a4f258f6 100644 --- a/src/mac/carbon/statbrma.cpp +++ b/src/mac/carbon/statbrma.cpp @@ -9,14 +9,12 @@ // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "statbrma.h" -#endif - // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- +#include "wx/wxprec.h" + #include "wx/statusbr.h" #include "wx/dc.h" #include "wx/dcclient.h" @@ -27,6 +25,7 @@ END_EVENT_TABLE() #ifdef __WXMAC__ #include "wx/mac/private.h" +#include "wx/toplevel.h" #endif // ============================================================================ @@ -53,7 +52,11 @@ bool wxStatusBarMac::Create(wxWindow *parent, wxWindowID id, if( !wxStatusBarGeneric::Create( parent , id , style , name ) ) return FALSE ; - m_macBackgroundBrush.MacSetTheme( kThemeBrushDialogBackgroundActive ) ; + if ( parent->MacGetTopLevelWindow()->MacGetMetalAppearance() ) + MacSetBackgroundBrush( wxNullBrush ) ; + + // normal system font is too tall for fitting into the standard height + SetWindowVariant( wxWINDOW_VARIANT_SMALL ) ; return TRUE ; } @@ -66,7 +69,7 @@ void wxStatusBarMac::DrawFieldText(wxDC& dc, int i) wxRect rect; GetFieldRect(i, rect); - if ( !IsWindowHilited( MAC_WXHWND( MacGetTopLevelWindowRef() ) ) ) + if ( !MacIsReallyHilited() ) { dc.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ; } @@ -80,6 +83,9 @@ void wxStatusBarMac::DrawFieldText(wxDC& dc, int i) int xpos = rect.x + leftMargin + 1 ; int ypos = 1 ; + if ( MacGetTopLevelWindow()->MacGetMetalAppearance() ) + ypos++ ; + dc.SetClippingRegion(rect.x, 0, rect.width, h); dc.DrawText(text, xpos, ypos); @@ -97,6 +103,9 @@ void wxStatusBarMac::SetStatusText(const wxString& text, int number) wxCHECK_RET( (number >= 0) && (number < m_nFields), _T("invalid status bar field index") ); + if ( m_statusStrings[number] == text ) + return ; + m_statusStrings[number] = text; wxRect rect; GetFieldRect(number, rect); @@ -118,17 +127,20 @@ void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) ) int w, h ; GetSize( &w , &h ) ; - if ( IsWindowHilited( MAC_WXHWND( MacGetTopLevelWindowRef() ) ) ) + if ( MacIsReallyHilited() ) { - wxPen white( wxWHITE , 1 , wxSOLID ) ; - if (major >= 10) + wxPen white( *wxWHITE , 1 , wxSOLID ) ; + if (major >= 10 ) { //Finder statusbar border color: (Project builder similar is 9B9B9B) - dc.SetPen(wxPen(wxColour(0xB1,0xB1,0xB1),1,wxSOLID)); + if ( MacGetTopLevelWindow()->MacGetMetalAppearance() ) + dc.SetPen(wxPen(wxColour(0x40,40,40) ,1,wxSOLID)) ; + else + dc.SetPen(wxPen(wxColour(0xB1,0xB1,0xB1),1,wxSOLID)); } else { - wxPen black( wxBLACK , 1 , wxSOLID ) ; + wxPen black( *wxBLACK , 1 , wxSOLID ) ; dc.SetPen(black); } dc.DrawLine(0, 0 , @@ -157,3 +169,9 @@ void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) ) for ( i = 0; i < m_nFields; i ++ ) DrawField(dc, i); } + +void wxStatusBarMac::MacHiliteChanged() +{ + Refresh() ; + Update() ; +}