X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/80f3f3beb68c3aabfdf521e78b383c41399ac75e..8064223b7b1b3657363b7a635c381b9269d95e55:/src/mac/carbon/settings.cpp diff --git a/src/mac/carbon/settings.cpp b/src/mac/carbon/settings.cpp index 669260c1df..58cecfb357 100644 --- a/src/mac/carbon/settings.cpp +++ b/src/mac/carbon/settings.cpp @@ -30,13 +30,9 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index) { - int major, minor; wxColour resultColor; - RGBColor macRGB; ThemeBrush colorBrushID; - wxGetOsVersion( &major, &minor ); - switch ( index ) { case wxSYS_COLOUR_WINDOW: @@ -56,17 +52,11 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index) break ; case wxSYS_COLOUR_LISTBOX : - if (major >= 10) - resultColor = *wxWHITE ; - else - resultColor = wxColor( 0xEE, 0xEE, 0xEE ); + resultColor = *wxWHITE ; break ; case wxSYS_COLOUR_BTNSHADOW: - if (major >= 10) - resultColor = wxColor( 0xBE, 0xBE, 0xBE ); - else - resultColor = wxColor( 0x44, 0x44, 0x44 ); + resultColor = wxColor( 0xBE, 0xBE, 0xBE ); break ; case wxSYS_COLOUR_BTNTEXT: @@ -79,16 +69,15 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index) break ; case wxSYS_COLOUR_HIGHLIGHT: - + { #if 0 // NB: enable this case as desired - colorBrushID = kThemeBrushAlternatePrimaryHighlightColor; + colorBrushID = kThemeBrushAlternatePrimaryHighlightColor; #else - colorBrushID = kThemeBrushPrimaryHighlightColor; + colorBrushID = kThemeBrushPrimaryHighlightColor; #endif - - GetThemeBrushAsColor( colorBrushID, 32, true, &macRGB ); - resultColor = wxColor( macRGB ); + resultColor = wxColor( wxMacCreateCGColorFromHITheme(colorBrushID) ); + } break ; case wxSYS_COLOUR_BTNHIGHLIGHT: @@ -109,16 +98,20 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index) // NB: enable this case as desired resultColor = *wxWHITE ; #else - GetThemeBrushAsColor( kThemeBrushPrimaryHighlightColor, 32, true, &macRGB ); - if ((macRGB.red + macRGB.green + macRGB.blue) == 0) - resultColor = *wxWHITE ; - else - resultColor = *wxBLACK ; + { + wxColour highlightcolor( wxMacCreateCGColorFromHITheme(kThemeBrushPrimaryHighlightColor) ); + if ((highlightcolor.Red() + highlightcolor.Green() + highlightcolor.Blue() ) == 0) + resultColor = *wxWHITE ; + else + resultColor = *wxBLACK ; + } #endif break ; case wxSYS_COLOUR_INFOBK : - resultColor = *wxWHITE ; + // we don't have a way to detect tooltip color, so use the + // standard value used at least on 10.4: + resultColor = wxColour( 0xFF, 0xFF, 0xD3 ) ; break ; case wxSYS_COLOUR_APPWORKSPACE: resultColor = wxColor( 0x80, 0x80, 0x80 ); ; @@ -234,8 +227,13 @@ int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(w // TODO: case wxSYS_SHOW_SOUNDS: case wxSYS_DCLICK_MSEC: +#ifdef __LP64__ + // default on mac is 30 ticks, we shouldn't really use wxSYS_DCLICK_MSEC anyway + // but rather rely on the 'click-count' by the system delivered in a mouse event + return 500; +#else return (int)(GetDblTime() * 1000. / 60.); - +#endif default: // unsupported metric break;