X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0966d1fe2639772efab156387f95f63ce766bf17..08dd04d0829cd2c4defe5233f061221d534dee0d:/src/mac/carbon/statbrma.cpp?ds=sidebyside diff --git a/src/mac/carbon/statbrma.cpp b/src/mac/carbon/statbrma.cpp index 29131affcd..c926d76b01 100644 --- a/src/mac/carbon/statbrma.cpp +++ b/src/mac/carbon/statbrma.cpp @@ -9,7 +9,7 @@ // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "statbrma.h" #endif @@ -17,6 +17,8 @@ // headers // ---------------------------------------------------------------------------- +#include "wx/wxprec.h" + #include "wx/statusbr.h" #include "wx/dc.h" #include "wx/dcclient.h" @@ -27,6 +29,7 @@ END_EVENT_TABLE() #ifdef __WXMAC__ #include "wx/mac/private.h" +#include "wx/toplevel.h" #endif // ============================================================================ @@ -56,6 +59,9 @@ bool wxStatusBarMac::Create(wxWindow *parent, wxWindowID id, if ( parent->MacGetTopLevelWindow()->MacGetMetalAppearance() ) MacSetBackgroundBrush( wxNullBrush ) ; + // normal system font is too tall for fitting into the standard height + SetWindowVariant( wxWINDOW_VARIANT_SMALL ) ; + return TRUE ; } @@ -67,7 +73,7 @@ void wxStatusBarMac::DrawFieldText(wxDC& dc, int i) wxRect rect; GetFieldRect(i, rect); - if ( !MacGetTopLevelWindow()->MacGetMetalAppearance() && !IsWindowHilited( MAC_WXHWND( MacGetTopLevelWindowRef() ) ) ) + if ( !MacIsReallyHilited() ) { dc.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ; } @@ -79,8 +85,11 @@ void wxStatusBarMac::DrawFieldText(wxDC& dc, int i) dc.GetTextExtent(text, &x, &y); int xpos = rect.x + leftMargin + 1 ; - int ypos = 2 ; + int ypos = 1 ; + if ( MacGetTopLevelWindow()->MacGetMetalAppearance() ) + ypos++ ; + dc.SetClippingRegion(rect.x, 0, rect.width, h); dc.DrawText(text, xpos, ypos); @@ -98,6 +107,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); @@ -119,9 +131,9 @@ void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) ) int w, h ; GetSize( &w , &h ) ; - if ( IsWindowHilited( MAC_WXHWND( MacGetTopLevelWindowRef() ) ) || MacGetTopLevelWindow()->MacGetMetalAppearance() ) + if ( MacIsReallyHilited() ) { - wxPen white( wxWHITE , 1 , wxSOLID ) ; + wxPen white( *wxWHITE , 1 , wxSOLID ) ; if (major >= 10 ) { //Finder statusbar border color: (Project builder similar is 9B9B9B) @@ -132,7 +144,7 @@ void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) ) } else { - wxPen black( wxBLACK , 1 , wxSOLID ) ; + wxPen black( *wxBLACK , 1 , wxSOLID ) ; dc.SetPen(black); } dc.DrawLine(0, 0 , @@ -161,3 +173,9 @@ void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) ) for ( i = 0; i < m_nFields; i ++ ) DrawField(dc, i); } + +void wxStatusBarMac::MacHiliteChanged() +{ + Refresh() ; + Update() ; +}