Give the correct colour for notebook pages under Vista with the default theme,

if we're using a solid colour background. wxUxThemeEngine::GetThemeColor doesn't
return the correct colour for Aero.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46236 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2007-05-29 13:15:33 +00:00
parent 65d722ba54
commit b380533ca2

View File

@ -1303,14 +1303,17 @@ wxColour wxNotebook::GetThemeBackgroundColour() const
if (hTheme)
{
// This is total guesswork.
// See PlatformSDK\Include\Tmschema.h for values
// See PlatformSDK\Include\Tmschema.h for values.
// JACS: can also use 9 (TABP_PANE)
COLORREF themeColor;
wxUxThemeEngine::Get()->GetThemeColor(
bool success = (S_OK == wxUxThemeEngine::Get()->GetThemeColor(
hTheme,
10 /* TABP_BODY */,
1 /* NORMAL */,
3821 /* FILLCOLORHINT */,
&themeColor);
&themeColor));
if (!success)
return GetBackgroundColour();
/*
[DS] Workaround for WindowBlinds:
@ -1331,7 +1334,33 @@ wxColour wxNotebook::GetThemeBackgroundColour() const
&themeColor);
}
return wxRGBToColour(themeColor);
wxColour colour = wxRGBToColour(themeColor);
// Under Vista, the tab background colour is reported incorrectly.
// So for the default theme at least, hard-code the colour to something
// that will blend in.
static int s_AeroStatus = -1;
if (s_AeroStatus == -1)
{
WCHAR szwThemeFile[1024];
WCHAR szwThemeColor[256];
if (S_OK == wxUxThemeEngine::Get()->GetCurrentThemeName(szwThemeFile, 1024, szwThemeColor, 256, NULL, 0))
{
wxString themeFile(szwThemeFile), themeColor(szwThemeColor);
if (themeFile.Find(wxT("Aero")) != -1 && themeColor == wxT("NormalColor"))
s_AeroStatus = 1;
else
s_AeroStatus = 0;
}
else
s_AeroStatus = 0;
}
if (s_AeroStatus == 1)
colour = wxColour(255, 255, 255);
return colour;
}
}
#endif // wxUSE_UXTHEME