X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/76e36d433484b94cb5b7c3668fbce85ceebe508c..9d5507f7a2701395e1d5c121bd877bb9066ee6ea:/src/mac/carbon/settings.cpp diff --git a/src/mac/carbon/settings.cpp b/src/mac/carbon/settings.cpp index 6f19bfb7dc..03f1f1dceb 100644 --- a/src/mac/carbon/settings.cpp +++ b/src/mac/carbon/settings.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: settings.cpp +// Name: src/mac/carbon/settings.cpp // Purpose: wxSettings // Author: Stefan Csomor // Modified by: @@ -12,8 +12,11 @@ #include "wx/wxprec.h" #include "wx/settings.h" -#include "wx/gdicmn.h" -#include "wx/utils.h" + +#ifndef WX_PRECOMP + #include "wx/utils.h" + #include "wx/gdicmn.h" +#endif #include "wx/mac/uma.h" @@ -27,21 +30,19 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index) { - int major, minor; wxColour resultColor; - RGBColor macRGB; ThemeBrush colorBrushID; - wxGetOsVersion( &major, &minor ); - switch ( index ) { + case wxSYS_COLOUR_WINDOW: + resultColor = *wxWHITE ; + break ; case wxSYS_COLOUR_SCROLLBAR : case wxSYS_COLOUR_BACKGROUND: case wxSYS_COLOUR_ACTIVECAPTION: case wxSYS_COLOUR_INACTIVECAPTION: case wxSYS_COLOUR_MENU: - case wxSYS_COLOUR_WINDOW: case wxSYS_COLOUR_WINDOWFRAME: case wxSYS_COLOUR_ACTIVEBORDER: case wxSYS_COLOUR_INACTIVEBORDER: @@ -51,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: @@ -74,16 +69,15 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index) break ; case wxSYS_COLOUR_HIGHLIGHT: - -#if 0 && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3) + { +#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.red >> 8, macRGB.green >> 8, macRGB.blue >> 8 ); + resultColor = wxColor( wxMacCreateCGColorFromHITheme(colorBrushID) ); + } break ; case wxSYS_COLOUR_BTNHIGHLIGHT: @@ -100,22 +94,26 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index) break ; case wxSYS_COLOUR_HIGHLIGHTTEXT : -#if 0 && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3) +#if 0 // 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 : - case wxSYS_COLOUR_APPWORKSPACE: resultColor = *wxWHITE ; break ; + case wxSYS_COLOUR_APPWORKSPACE: + resultColor = wxColor( 0x80, 0x80, 0x80 ); ; + break ; case wxSYS_COLOUR_HOTLIGHT: case wxSYS_COLOUR_GRADIENTACTIVECAPTION: @@ -226,6 +224,14 @@ int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(w // TODO: case wxSYS_NETWORK_PRESENT: // 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;