Allow theme CSS to distinguish between themed and non-themed in Windows - bug 431666 r=vlad r=dbaron

This commit is contained in:
Kai Liu 2008-08-18 10:33:08 -07:00
parent fd593fb72f
commit 0dccff6dc5
8 changed files with 22 additions and 0 deletions

View File

@ -797,6 +797,11 @@ InitSystemMetrics()
sSystemMetrics->AppendElement(do_GetAtom("windows-compositor"));
}
rv = lookAndFeel->GetMetric(nsILookAndFeel::eMetric_WindowsClassic, metricResult);
if (NS_SUCCEEDED(rv) && metricResult) {
sSystemMetrics->AppendElement(do_GetAtom("windows-classic"));
}
return PR_TRUE;
}

View File

@ -243,6 +243,15 @@ public:
*/
eMetric_DWMCompositor,
/*
* A Boolean value to determine whether Windows is themed (Classic vs.
* uxtheme)
*
* This is Windows-specific and is not implemented on other platforms
* (will return the default of NS_ERROR_FAILURE).
*/
eMetric_WindowsClassic,
/*
* eMetric_AlertNotificationOrigin indicates from which corner of the
* screen alerts slide in, and from which direction (horizontal/vertical).

View File

@ -422,6 +422,7 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
aMetric = 3;
break;
case eMetric_DWMCompositor:
case eMetric_WindowsClassic:
case eMetric_WindowsDefaultTheme:
aMetric = 0;
res = NS_ERROR_NOT_IMPLEMENTED;

View File

@ -601,6 +601,7 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
aMetric = 3;
break;
case eMetric_DWMCompositor:
case eMetric_WindowsClassic:
case eMetric_WindowsDefaultTheme:
aMetric = 0;
res = NS_ERROR_NOT_IMPLEMENTED;

View File

@ -555,6 +555,7 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
aMetric = 3;
break;
case eMetric_DWMCompositor:
case eMetric_WindowsClassic:
case eMetric_WindowsDefaultTheme:
aMetric = 0;
res = NS_ERROR_NOT_IMPLEMENTED;

View File

@ -367,6 +367,7 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
aMetric = 3;
break;
case eMetric_DWMCompositor:
case eMetric_WindowsClassic:
case eMetric_WindowsDefaultTheme:
aMetric = 0;
res = NS_ERROR_NOT_IMPLEMENTED;

View File

@ -364,6 +364,7 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
aMetric = 3;
break;
case eMetric_DWMCompositor:
case eMetric_WindowsClassic:
case eMetric_WindowsDefaultTheme:
aMetric = 0;
res = NS_ERROR_NOT_IMPLEMENTED;

View File

@ -480,6 +480,9 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
case eMetric_TreeScrollLinesMax:
aMetric = 3;
break;
case eMetric_WindowsClassic:
aMetric = !nsUXThemeData::IsAppThemed();
break;
case eMetric_WindowsDefaultTheme:
aMetric = 0;
#ifndef WINCE