X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1f0c8f31f407ecfce909060464c0ea655221cdab..f4bc1aa27cb33f679d7e9c1518a7855bbc1fa471:/src/osx/carbon/renderer.cpp?ds=sidebyside diff --git a/src/osx/carbon/renderer.cpp b/src/osx/carbon/renderer.cpp index 8eb4e180e7..ee4b05d680 100644 --- a/src/osx/carbon/renderer.cpp +++ b/src/osx/carbon/renderer.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: src/mac/carbon/renderer.cpp +// Name: src/osx/carbon/renderer.cpp // Purpose: implementation of wxRendererNative for Mac // Author: Vadim Zeitlin // Modified by: @@ -27,8 +27,13 @@ #include "wx/renderer.h" #include "wx/graphics.h" -#include "wx/osx/uma.h" +#include "wx/dcgraph.h" +#include "wx/osx/private.h" +#if wxOSX_USE_COCOA +// bring in the theme headers +#include +#endif class WXDLLEXPORT wxRendererMac : public wxDelegateRendererNative { @@ -62,6 +67,8 @@ public: const wxRect& rect, int flags = 0); + virtual wxSize GetCheckBoxSize(wxWindow* win); + virtual void DrawComboBoxDropButton(wxWindow *win, wxDC& dc, const wxRect& rect, @@ -236,7 +243,7 @@ void wxRendererMac::DrawSplitterSash( wxWindow *win, wxOrientation orient, int WXUNUSED(flags) ) { - bool hasMetal = win->MacGetTopLevelWindow()->MacGetMetalAppearance(); + bool hasMetal = win->MacGetTopLevelWindow()->GetExtraStyle() & wxFRAME_EX_METAL; SInt32 height; GetThemeMetric( kThemeMetricSmallPaneSplitterHeight, &height ); HIRect splitterRect; @@ -344,6 +351,27 @@ wxRendererMac::DrawCheckBox(wxWindow *win, kThemeCheckBox, kThemeAdornmentNone); } +wxSize wxRendererMac::GetCheckBoxSize(wxWindow* WXUNUSED(win)) +{ + wxSize size; + SInt32 width, height; + OSStatus errStatus; + + errStatus = GetThemeMetric(kThemeMetricCheckBoxWidth, &width); + if (errStatus == noErr) + { + size.SetWidth(width); + } + + errStatus = GetThemeMetric(kThemeMetricCheckBoxHeight, &height); + if (errStatus == noErr) + { + size.SetHeight(height); + } + + return size; +} + void wxRendererMac::DrawComboBoxDropButton(wxWindow *win, wxDC& dc, @@ -405,4 +433,3 @@ wxRendererMac::DrawFocusRect(wxWindow* win, wxDC& dc, const wxRect& rect, int fl HIThemeDrawFocusRect( &cgrect , true , cgContext , kHIThemeOrientationNormal ) ; } -