mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-15 23:21:28 +00:00
encode and decode themeClass
This makes it possible to theme any themeClass without having to subclass a CPView and return something different from defaultThemeClass. Theme a custom theme class by assigning to a control within the theme descriptor ([control setThemeClass:"your-theme-class"]).
This commit is contained in:
@@ -2521,6 +2521,7 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",
|
||||
CPViewSubviewsKey = @"CPViewSubviewsKey",
|
||||
CPViewSuperviewKey = @"CPViewSuperviewKey",
|
||||
CPViewTagKey = @"CPViewTagKey",
|
||||
CPViewThemeClassKey = @"CPViewThemeClassKey",
|
||||
CPViewThemeStateKey = @"CPViewThemeStateKey",
|
||||
CPViewWindowKey = @"CPViewWindowKey",
|
||||
CPViewNextKeyViewKey = @"CPViewNextKeyViewKey",
|
||||
@@ -2600,6 +2601,7 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",
|
||||
[self setupViewFlags];
|
||||
|
||||
_theme = [CPTheme defaultTheme];
|
||||
_themeClass = [aCoder decodeObjectForKey:CPViewThemeClassKey];
|
||||
_themeState = CPThemeState([aCoder decodeIntForKey:CPViewThemeStateKey]);
|
||||
_themeAttributes = {};
|
||||
|
||||
@@ -2687,6 +2689,7 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",
|
||||
if (previousKeyView !== nil)
|
||||
[aCoder encodeConditionalObject:previousKeyView forKey:CPViewPreviousKeyViewKey];
|
||||
|
||||
[aCoder encodeObject:[self themeClass] forKey:CPViewThemeClassKey];
|
||||
[aCoder encodeInt:CPThemeStateName(_themeState) forKey:CPViewThemeStateKey];
|
||||
|
||||
for (var attributeName in _themeAttributes)
|
||||
|
||||
Reference in New Issue
Block a user