Make the names in +themeShowcaseExcludes case-insensitive

This commit is contained in:
Aparajita Fishman
2010-08-31 22:09:29 -04:00
committed by Alexander Ljungberg
parent 6b940116be
commit be36e17bd8
2 changed files with 8 additions and 5 deletions
+3 -2
View File
@@ -165,11 +165,12 @@ var themedButtonValues = nil,
+ (CPArray)themeShowcaseExcludes
{
return ["themedAlert", "cornerView", "tableDataView"];
return ["themedAlert", "cornerview", "tableDataView"];
}
Note that to make it easier to do the right thing, the names in the array can begin with "themed" or not.
If the name does not begin with "themed", it is prepended and the first character uppercased if it is not there.
If the name does not begin with "themed", it is prepended. Name matching is case-insensitive, so you
don't have to worry about capitalization.
SUBTHEMES
+5 -3
View File
@@ -146,10 +146,12 @@ var ItemSizes = { },
for (; index < excludes.length; ++index)
{
var name = excludes[index];
var name = excludes[index].toLowerCase();
if (name && name.indexOf("themed") !== 0)
excludes[index] = "themed" + name.charAt(0).toUpperCase() + name.substr(1);
excludes[index] = "themed" + name;
else
excludes[index] = name;
}
for (index = 0; index < count; ++index)
@@ -167,7 +169,7 @@ var ItemSizes = { },
continue;
var template = [[BKThemedObjectTemplate alloc] init],
excluded = [excludes containsObject:selector];
excluded = [excludes containsObject:selector.toLowerCase()];
[template setValue:object forKey:@"themedObject"];
[template setValue:BKLabelFromIdentifier(selector) forKey:@"label"];