Permalink
Browse files

Toggle between two styles

  • Loading branch information...
1 parent ac1b86e commit f945fe7e208c35cd10961784b8fabfb8e5ccb2bf @newyankeecodeshop committed Sep 21, 2011
Showing with 14 additions and 2 deletions.
  1. +14 −2 Samples/Theme Explorer/ThemeAppDelegate.m
@@ -55,7 +55,7 @@ - (IBAction)changeTheme:(id)sender
{
if (_themeChanged)
{
-#if 1
+ // TODO: change the theme color
NSString* curTheme = [_scriptEngine.documentObject valueForKeyPath:@"body.className"];
if ([curTheme isEqualToString:@"red_theme"])
@@ -64,7 +64,6 @@ - (IBAction)changeTheme:(id)sender
curTheme = @"red_theme";
[_scriptEngine.documentObject setValue:curTheme forKeyPath:@"body.className"];
-#endif
}
[_window applyStylesWithScriptEngine:_scriptEngine];
@@ -156,3 +155,16 @@ - (void)navigationController:(UINavigationController *)navigationController
}
@end
+
+/*
+
+ NSString* curTheme = [_scriptEngine.documentObject valueForKeyPath:@"body.className"];
+
+ if ([curTheme isEqualToString:@"red_theme"])
+ curTheme = @"blue_theme";
+ else
+ curTheme = @"red_theme";
+
+ [_scriptEngine.documentObject setValue:curTheme forKeyPath:@"body.className"];
+
+*/

0 comments on commit f945fe7

Please sign in to comment.