<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>AppKit/Tools/BlendKit/BKThemeDescriptor.j</filename>
    </added>
    <added>
      <filename>AppKit/Tools/BlendKit/Resources/dark-checkers.png</filename>
    </added>
    <added>
      <filename>AppKit/Tools/BlendKit/Resources/light-checkers.png</filename>
    </added>
    <added>
      <filename>AppKit/Tools/BlendKit/Resources/selection.png</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -476,6 +476,11 @@ CPRunContinuesResponse  = -1002;
     _mainMenu = aMenu;
 }
 
+- (void)orderFrontColorPanel:(id)aSender
+{
+    [[CPColorPanel sharedColorPanel] orderFront:self];
+}
+
 - (void)orderFrontStandardAboutPanel:(id)aSender
 {
     [self orderFrontStandardAboutPanelWithOptions:nil];</diff>
      <filename>AppKit/CPApplication.j</filename>
    </modified>
    <modified>
      <diff>@@ -502,7 +502,7 @@ CPPopUpButtonStatePullsDown = CPThemeState(&quot;pulls-down&quot;);
 {
     if ([self title] === aTitle)
         return;
-    
+
     if ([self pullsDown])
     {
         var items = [_menu itemArray];</diff>
      <filename>AppKit/CPPopUpButton.j</filename>
    </modified>
    <modified>
      <diff>@@ -10,7 +10,7 @@
 @import &lt;AppKit/AppKit.j&gt;
 
 
-@implementation AristoThemeDescriptor : CPObject
+@implementation AristoThemeDescriptor : BKThemeDescriptor
 {
 }
 
@@ -19,6 +19,137 @@
     return @&quot;Aristo&quot;;
 }
 
++ (CPButton)button
+{
+    var button = [[CPButton alloc] initWithFrame:CGRectMake(0.0, 0.0, 60.0, 24.0)],
+
+        bezelColor = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:
+            [
+                [_CPCibCustomResource imageResourceWithName:&quot;button-bezel-left.png&quot; size:CGSizeMake(4.0, 24.0)],
+                [_CPCibCustomResource imageResourceWithName:&quot;button-bezel-center.png&quot; size:CGSizeMake(1.0, 24.0)],
+                [_CPCibCustomResource imageResourceWithName:&quot;button-bezel-right.png&quot; size:CGSizeMake(4.0, 24.0)]
+            ]
+        isVertical:NO]],
+
+        highlightedBezelColor = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:
+            [
+                [_CPCibCustomResource imageResourceWithName:&quot;button-bezel-highlighted-left.png&quot; size:CGSizeMake(4.0, 24.0)],
+                [_CPCibCustomResource imageResourceWithName:&quot;button-bezel-highlighted-center.png&quot; size:CGSizeMake(1.0, 24.0)],
+                [_CPCibCustomResource imageResourceWithName:&quot;button-bezel-highlighted-right.png&quot; size:CGSizeMake(4.0, 24.0)]
+            ]
+        isVertical:NO]],
+
+        defaultBezelColor = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:
+            [
+                [_CPCibCustomResource imageResourceWithName:&quot;default-button-bezel-left.png&quot; size:CGSizeMake(4.0, 24.0)],
+                [_CPCibCustomResource imageResourceWithName:&quot;default-button-bezel-center.png&quot; size:CGSizeMake(1.0, 24.0)],
+                [_CPCibCustomResource imageResourceWithName:&quot;default-button-bezel-right.png&quot; size:CGSizeMake(4.0, 24.0)]
+            ]
+        isVertical:NO]],
+
+        defaultHighlightedBezelColor = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:
+            [
+                [_CPCibCustomResource imageResourceWithName:&quot;default-button-bezel-highlighted-left.png&quot; size:CGSizeMake(4.0, 24.0)],
+                [_CPCibCustomResource imageResourceWithName:&quot;default-button-bezel-highlighted-center.png&quot; size:CGSizeMake(1.0, 24.0)],
+                [_CPCibCustomResource imageResourceWithName:&quot;default-button-bezel-highlighted-right.png&quot; size:CGSizeMake(4.0, 24.0)]
+            ]
+        isVertical:NO]];
+
+    [button setValue:[CPFont boldSystemFontOfSize:12.0] forThemeAttribute:@&quot;font&quot; inState:CPThemeStateBordered];
+    [button setValue:[CPColor colorWithCalibratedWhite:79.0 / 255.0 alpha:1.0] forThemeAttribute:@&quot;text-color&quot;];
+    [button setValue:[CPColor colorWithCalibratedWhite:240.0 / 255.0 alpha:1.0] forThemeAttribute:@&quot;text-shadow-color&quot; inState:CPThemeStateBordered];
+    [button setValue:CGSizeMake(0.0, 1.0) forThemeAttribute:@&quot;text-shadow-offset&quot; inState:CPThemeStateBordered];
+    [button setValue:CPLineBreakByTruncatingTail forThemeAttribute:@&quot;line-break-mode&quot;];
+    
+    [button setValue:bezelColor forThemeAttribute:@&quot;bezel-color&quot; inState:CPThemeStateBordered];
+    [button setValue:highlightedBezelColor forThemeAttribute:@&quot;bezel-color&quot; inState:CPThemeStateBordered|CPThemeStateHighlighted];
+    [button setValue:CGInsetMake(0.0, 5.0, 0.0, 5.0) forThemeAttribute:@&quot;content-inset&quot; inState:CPThemeStateBordered];
+
+    [button setValue:defaultBezelColor forThemeAttribute:@&quot;bezel-color&quot; inState:CPThemeStateBordered|CPThemeStateDefault];
+    [button setValue:defaultHighlightedBezelColor forThemeAttribute:@&quot;bezel-color&quot; inState:CPThemeStateBordered|CPThemeStateHighlighted|CPThemeStateDefault];
+    [button setValue:[CPColor colorWithCalibratedRed:13.0/255.0 green:51.0/255.0 blue:70.0/255.0 alpha:1.0] forThemeAttribute:@&quot;text-color&quot; inState:CPThemeStateDefault];
+
+    [button setValue:CGSizeMake(0.0, 24.0) forThemeAttribute:@&quot;min-size&quot;];
+    [button setValue:CGSizeMake(-1.0, 24.0) forThemeAttribute:@&quot;max-size&quot;];
+
+    return button;
+}
+
++ (CPButton)themedStandardButton
+{
+    var button = [self button];
+    
+    [button setTitle:@&quot;Cancel&quot;];
+
+    return button;
+}
+
++ (CPButton)themedDefaultButton
+{
+    var button = [self button];
+
+    [button setTitle:@&quot;OK&quot;];
+    [button setDefaultButton:YES];
+
+    return button;
+}
+
++ (CPPopUpButton)themedPopUpButton
+{
+    var button = [[CPPopUpButton alloc] initWithFrame:CGRectMake(0.0, 0.0, 100.0, 24.0) pullsDown:NO],
+        color = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:
+            [
+                [_CPCibCustomResource imageResourceWithName:&quot;button-bezel-left.png&quot; size:CGSizeMake(4.0, 24.0)],
+                [_CPCibCustomResource imageResourceWithName:&quot;button-bezel-center.png&quot; size:CGSizeMake(1.0, 24.0)],
+                [_CPCibCustomResource imageResourceWithName:&quot;popup-bezel-right.png&quot; size:CGSizeMake(27.0, 24.0)]
+            ]
+        isVertical:NO]];
+    
+    [button setTitle:@&quot;Pop Up&quot;];
+    
+    [button setValue:color forThemeAttribute:@&quot;bezel-color&quot; inState:CPThemeStateBordered];
+    [button setValue:CGInsetMake(0, 27.0 + 5.0, 0, 5.0) forThemeAttribute:@&quot;content-inset&quot; inState:CPThemeStateBordered];
+    [button setValue:[CPFont boldSystemFontOfSize:12.0] forThemeAttribute:@&quot;font&quot;];
+    [button setValue:[CPColor colorWithCalibratedWhite:79.0 / 255.0 alpha:1.0] forThemeAttribute:@&quot;text-color&quot;];
+    [button setValue:[CPColor colorWithCalibratedWhite:240.0 / 255.0 alpha:1.0] forThemeAttribute:@&quot;text-shadow-color&quot;];
+    [button setValue:CGSizeMake(0.0, 1.0) forThemeAttribute:@&quot;text-shadow-offset&quot;];
+
+    [button setValue:CGSizeMake(32.0, 24.0) forThemeAttribute:@&quot;min-size&quot;];
+    [button setValue:CGSizeMake(-1.0, 24.0) forThemeAttribute:@&quot;max-size&quot;];    
+
+    [button addItemWithTitle:@&quot;item&quot;];
+    
+    return button;
+}
+
++ (CPPopUpButton)themedPullDownMenu
+{
+    var button = [[CPPopUpButton alloc] initWithFrame:CGRectMake(0.0, 0.0, 100.0, 24.0) pullsDown:YES],
+        color = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:
+            [
+                [_CPCibCustomResource imageResourceWithName:&quot;button-bezel-left.png&quot; size:CGSizeMake(4.0, 24.0)],
+                [_CPCibCustomResource imageResourceWithName:&quot;button-bezel-center.png&quot; size:CGSizeMake(1.0, 24.0)],
+                [_CPCibCustomResource imageResourceWithName:&quot;popup-bezel-right-pullsdown.png&quot; size:CGSizeMake(27.0, 24.0)]
+            ]
+        isVertical:NO]];
+
+    [button setTitle:@&quot;Pull Down&quot;];
+
+    [button setValue:color forThemeAttribute:@&quot;bezel-color&quot; inState:CPPopUpButtonStatePullsDown|CPThemeStateBordered];
+    [button setValue:CGInsetMake(0, 27.0 + 5.0, 0, 5.0) forThemeAttribute:@&quot;content-inset&quot; inState:CPThemeStateBordered];
+    [button setValue:[CPFont boldSystemFontOfSize:12.0] forThemeAttribute:@&quot;font&quot;];
+    [button setValue:[CPColor colorWithCalibratedWhite:79.0 / 255.0 alpha:1.0] forThemeAttribute:@&quot;text-color&quot;];
+    [button setValue:[CPColor colorWithCalibratedWhite:240.0 / 255.0 alpha:1.0] forThemeAttribute:@&quot;text-shadow-color&quot;];
+    [button setValue:CGSizeMake(0.0, 1.0) forThemeAttribute:@&quot;text-shadow-offset&quot;];
+
+    [button setValue:CGSizeMake(32.0, 24.0) forThemeAttribute:@&quot;min-size&quot;];
+    [button setValue:CGSizeMake(-1.0, 24.0) forThemeAttribute:@&quot;max-size&quot;];
+
+    [button addItemWithTitle:@&quot;item&quot;];
+
+    return button;
+}
+
 + (CPScroller)themedVerticalScroller
 {
     var scroller = [[CPScroller alloc] initWithFrame:CGRectMake(0.0, 0.0, 17.0, 170.0)],
@@ -69,11 +200,11 @@
 {
     var scroller = [[CPScroller alloc] initWithFrame:CGRectMake(0.0, 0.0, 170.0, 17.0)],
         trackColor = PatternColor([_CPCibCustomResource imageResourceWithName:&quot;scroller-horizontal-track.png&quot; size:CGSizeMake(1.0, 17.0)]),
-        disabledTrackColor = PatternColor([_CPCibCustomResource imageResourceWithName:&quot;scroller-vertical-track-disabled.png&quot; size:CGSizeMake(17.0, 1.0)]);
+        disabledTrackColor = PatternColor([_CPCibCustomResource imageResourceWithName:&quot;scroller-horizontal-track-disabled.png&quot; size:CGSizeMake(17.0, 1.0)]);
 
     [scroller setValue:19.0 forThemeAttribute:@&quot;minimum-knob-length&quot;];
     [scroller setValue:CGInsetMake(2.0, 0.0, 0.0, 0.0) forThemeAttribute:@&quot;knob-inset&quot;];
-    [scroller setValue:CGInsetMake(0.0, -9.0, 0.0, -11.0) forThemeAttribute:@&quot;track-inset&quot;];
+    [scroller setValue:CGInsetMake(0.0, -10.0, 0.0, -11.0) forThemeAttribute:@&quot;track-inset&quot;];
 
     [scroller setValue:trackColor forThemeAttribute:@&quot;knob-slot-color&quot;];
     [scroller setValue:disabledTrackColor forThemeAttribute:@&quot;knob-slot-color&quot; inState:CPThemeStateDisabled];
@@ -200,65 +331,6 @@
     return textfield;
 }
 
-+ (CPButton)themedButton
-{
-    var button = [[CPButton alloc] initWithFrame:CGRectMake(0.0, 0.0, 60.0, 24.0)],
-
-        bezelColor = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:
-            [
-                [_CPCibCustomResource imageResourceWithName:&quot;button-bezel-left.png&quot; size:CGSizeMake(4.0, 24.0)],
-                [_CPCibCustomResource imageResourceWithName:&quot;button-bezel-center.png&quot; size:CGSizeMake(1.0, 24.0)],
-                [_CPCibCustomResource imageResourceWithName:&quot;button-bezel-right.png&quot; size:CGSizeMake(4.0, 24.0)]
-            ]
-        isVertical:NO]],
-
-        highlightedBezelColor = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:
-            [
-                [_CPCibCustomResource imageResourceWithName:&quot;button-bezel-highlighted-left.png&quot; size:CGSizeMake(4.0, 24.0)],
-                [_CPCibCustomResource imageResourceWithName:&quot;button-bezel-highlighted-center.png&quot; size:CGSizeMake(1.0, 24.0)],
-                [_CPCibCustomResource imageResourceWithName:&quot;button-bezel-highlighted-right.png&quot; size:CGSizeMake(4.0, 24.0)]
-            ]
-        isVertical:NO]],
-
-        defaultBezelColor = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:
-            [
-                [_CPCibCustomResource imageResourceWithName:&quot;default-button-bezel-left.png&quot; size:CGSizeMake(4.0, 24.0)],
-                [_CPCibCustomResource imageResourceWithName:&quot;default-button-bezel-center.png&quot; size:CGSizeMake(1.0, 24.0)],
-                [_CPCibCustomResource imageResourceWithName:&quot;default-button-bezel-right.png&quot; size:CGSizeMake(4.0, 24.0)]
-            ]
-        isVertical:NO]],
-
-        defaultHighlightedBezelColor = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:
-            [
-                [_CPCibCustomResource imageResourceWithName:&quot;default-button-bezel-highlighted-left.png&quot; size:CGSizeMake(4.0, 24.0)],
-                [_CPCibCustomResource imageResourceWithName:&quot;default-button-bezel-highlighted-center.png&quot; size:CGSizeMake(1.0, 24.0)],
-                [_CPCibCustomResource imageResourceWithName:&quot;default-button-bezel-highlighted-right.png&quot; size:CGSizeMake(4.0, 24.0)]
-            ]
-        isVertical:NO]];
-
-                
-    [button setTitle:@&quot;Cancel&quot;];
-    
-    [button setValue:[CPFont boldSystemFontOfSize:12.0] forThemeAttribute:@&quot;font&quot; inState:CPThemeStateBordered];
-    [button setValue:[CPColor colorWithCalibratedWhite:79.0 / 255.0 alpha:1.0] forThemeAttribute:@&quot;text-color&quot;];
-    [button setValue:[CPColor colorWithCalibratedWhite:240.0 / 255.0 alpha:1.0] forThemeAttribute:@&quot;text-shadow-color&quot; inState:CPThemeStateBordered];
-    [button setValue:CGSizeMake(0.0, 1.0) forThemeAttribute:@&quot;text-shadow-offset&quot; inState:CPThemeStateBordered];
-    [button setValue:CPLineBreakByTruncatingTail forThemeAttribute:@&quot;line-break-mode&quot;];
-    
-    [button setValue:bezelColor forThemeAttribute:@&quot;bezel-color&quot; inState:CPThemeStateBordered];
-    [button setValue:highlightedBezelColor forThemeAttribute:@&quot;bezel-color&quot; inState:CPThemeStateBordered|CPThemeStateHighlighted];
-    [button setValue:CGInsetMake(0.0, 5.0, 0.0, 5.0) forThemeAttribute:@&quot;content-inset&quot; inState:CPThemeStateBordered];
-
-    [button setValue:defaultBezelColor forThemeAttribute:@&quot;bezel-color&quot; inState:CPThemeStateBordered|CPThemeStateDefault];
-    [button setValue:defaultHighlightedBezelColor forThemeAttribute:@&quot;bezel-color&quot; inState:CPThemeStateBordered|CPThemeStateHighlighted|CPThemeStateDefault];
-    [button setValue:[CPColor colorWithCalibratedRed:13.0/255.0 green:51.0/255.0 blue:70.0/255.0 alpha:1.0] forThemeAttribute:@&quot;text-color&quot; inState:CPThemeStateDefault];
-
-    [button setValue:CGSizeMake(0.0, 24.0) forThemeAttribute:@&quot;min-size&quot;];
-    [button setValue:CGSizeMake(-1.0, 24.0) forThemeAttribute:@&quot;max-size&quot;];
-
-    return button;
-}
-
 + (CPRadioButton)themedRadioButton
 {
     var button = [[CPRadio alloc] initWithFrame:CGRectMake(0.0, 0.0, 120.0, 17.0)];
@@ -315,56 +387,6 @@
     return button;
 }
 
-+ (CPPopUpButton)themedPopUpButton
-{
-    var button = [[CPPopUpButton alloc] initWithFrame:CGRectMake(0.0, 0.0, 100.0, 24.0) pullsDown:NO],
-        color = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:
-            [
-                [_CPCibCustomResource imageResourceWithName:&quot;button-bezel-left.png&quot; size:CGSizeMake(4.0, 24.0)],
-                [_CPCibCustomResource imageResourceWithName:&quot;button-bezel-center.png&quot; size:CGSizeMake(1.0, 24.0)],
-                [_CPCibCustomResource imageResourceWithName:&quot;popup-bezel-right.png&quot; size:CGSizeMake(27.0, 24.0)]
-            ]
-        isVertical:NO]];
-    
-    [button setTitle:@&quot;Pop Up&quot;];
-    
-    [button setValue:color forThemeAttribute:@&quot;bezel-color&quot; inState:CPThemeStateBordered];
-    [button setValue:CGInsetMake(0, 27.0 + 5.0, 0, 5.0) forThemeAttribute:@&quot;content-inset&quot; inState:CPThemeStateBordered];
-    [button setValue:[CPFont boldSystemFontOfSize:12.0] forThemeAttribute:@&quot;font&quot;];
-    [button setValue:[CPColor colorWithCalibratedWhite:79.0 / 255.0 alpha:1.0] forThemeAttribute:@&quot;text-color&quot;];
-    [button setValue:[CPColor colorWithCalibratedWhite:240.0 / 255.0 alpha:1.0] forThemeAttribute:@&quot;text-shadow-color&quot;];
-    [button setValue:CGSizeMake(0.0, 1.0) forThemeAttribute:@&quot;text-shadow-offset&quot;];
-
-    [button addItemWithTitle:@&quot;item&quot;];
-    
-    return button;
-}
-
-+ (CPPopUpButton)themedPullDownMenu
-{
-    var button = [[CPPopUpButton alloc] initWithFrame:CGRectMake(0.0, 0.0, 100.0, 24.0) pullsDown:YES],
-        color = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:
-            [
-                [_CPCibCustomResource imageResourceWithName:&quot;button-bezel-left.png&quot; size:CGSizeMake(4.0, 24.0)],
-                [_CPCibCustomResource imageResourceWithName:&quot;button-bezel-center.png&quot; size:CGSizeMake(1.0, 24.0)],
-                [_CPCibCustomResource imageResourceWithName:&quot;popup-bezel-right-pullsdown.png&quot; size:CGSizeMake(27.0, 24.0)]
-            ]
-        isVertical:NO]];
-
-    [button setTitle:@&quot;Pop Up&quot;];
-
-    [button setValue:color forThemeAttribute:@&quot;bezel-color&quot; inState:CPPopUpButtonStatePullsDown|CPThemeStateBordered];
-    [button setValue:CGInsetMake(0, 27.0 + 5.0, 0, 5.0) forThemeAttribute:@&quot;content-inset&quot; inState:CPThemeStateBordered];
-    [button setValue:[CPFont boldSystemFontOfSize:12.0] forThemeAttribute:@&quot;font&quot;];
-    [button setValue:[CPColor colorWithCalibratedWhite:79.0 / 255.0 alpha:1.0] forThemeAttribute:@&quot;text-color&quot;];
-    [button setValue:[CPColor colorWithCalibratedWhite:240.0 / 255.0 alpha:1.0] forThemeAttribute:@&quot;text-shadow-color&quot;];
-    [button setValue:CGSizeMake(0.0, 1.0) forThemeAttribute:@&quot;text-shadow-offset&quot;];
-
-    [button addItemWithTitle:@&quot;item&quot;];
-
-    return button;
-}
-
 + (CPPopUpButton)themedSegmentedControl
 {
     var segmentedControl = [[CPSegmentedControl alloc] initWithFrame:CGRectMake(0.0, 0.0, 0.0, 24.0)];
@@ -527,7 +549,7 @@
 
 @end
 
-@implementation AristoHUDThemeDescriptor : CPObject
+@implementation AristoHUDThemeDescriptor : BKThemeDescriptor
 {
 }
 
@@ -536,7 +558,7 @@
     return @&quot;Aristo-HUD&quot;;
 }
 
-+ (CPColor)themeShowcaseBackgroundColor
++ (CPColor)defaultShowcaseBackgroundColor
 {
     return [CPColor blackColor];
 }</diff>
      <filename>AppKit/Themes/Aristo/ThemeDescriptors.j</filename>
    </modified>
    <modified>
      <diff>@@ -5,108 +5,344 @@
 @import &quot;BKUtilities.j&quot;
 
 
+var LEFT_PANEL_WIDTH    = 176.0;
+
+var BKStateToolbarItemIdentifier                    = @&quot;BKStateToolbarItemIdentifier&quot;,
+    BKBackgroundColorToolbarItemIdentifier          = @&quot;BKBackgroundColorToolbarItemIdentifier&quot;;
+
 @implementation BKShowcaseController : CPObject
 {
+    CPArray             _themeDescriptorClasses;
+
+    CPCollectionView    _themesCollectionView;
+    CPCollectionView    _themedObjectsCollectionView;
 }
 
 - (void)applicationDidFinishLaunching:(CPNotification)aNotification
 {
+    _themeDescriptorClasses = [BKThemeDescriptor allThemeDescriptorClasses];
+
     var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
-        contentView = [theWindow contentView],
+        toolbar = [[CPToolbar alloc] initWithIdentifier:@&quot;Toolbar&quot;];
+
+    [toolbar setDelegate:self];
+    [theWindow setToolbar:toolbar];
+
+    var contentView = [theWindow contentView],
         bounds = [contentView bounds],
-        themeDescriptorClasses = BKThemeDescriptorClasses();
-    
-    var tabView = [[CPTabView alloc] initWithFrame:bounds];
-    
-    [tabView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
-    
-    [contentView addSubview:tabView];
-    
-    var index = 0,
-        count = [themeDescriptorClasses count];
+        splitView = [[CPSplitView alloc] initWithFrame:bounds];
+
+    [splitView setIsPaneSplitter:YES];
+    [splitView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
+
+    [contentView addSubview:splitView];
+
+    // Left Pane
+    var label = [CPTextField labelWithTitle:@&quot;THEMES&quot;];
+
+    [label setFont:[CPFont boldSystemFontOfSize:11.0]];
+    [label setTextColor:[CPColor colorWithCalibratedRed:92.0 / 255.0 green:110.0 / 255.0 blue:129.0 / 255.0 alpha:1.0]];
+    [label setTextShadowColor:[CPColor colorWithCalibratedRed:225.0 / 255.0 green:255.0 / 255.0 blue:255.0 / 255.0 alpha:0.7]];
+    [label setTextShadowOffset:CGSizeMake(0.0, 1.0)];
+    [label sizeToFit];
+    [label setFrameOrigin:CGPointMake(5.0, 2.0)];
+
+    var themeDescriptorItem = [[CPCollectionViewItem alloc] init];
+
+    [themeDescriptorItem setView:[[BKThemeDescriptorCell alloc] init]];
+
+    _themesCollectionView = [[CPCollectionView alloc] initWithFrame:CGRectMake(0.0, 0.0, LEFT_PANEL_WIDTH, CGRectGetHeight(bounds))];
+
+    [_themesCollectionView setDelegate:self];
+    [_themesCollectionView setItemPrototype:themeDescriptorItem];
+    [_themesCollectionView setMinItemSize:CGSizeMake(20.0, 36.0)];
+    [_themesCollectionView setMaxItemSize:CGSizeMake(10000000.0, 36.0)];
+    [_themesCollectionView setMaxNumberOfColumns:1];
+    [_themesCollectionView setContent:_themeDescriptorClasses];
+    [_themesCollectionView setAutoresizingMask:CPViewWidthSizable];
+    [_themesCollectionView setVerticalMargin:0.0];
+    [_themesCollectionView setSelectable:YES];
+    [_themesCollectionView setFrameOrigin:CGPointMake(0.0, 20.0)];
+    [_themesCollectionView setAutoresizingMask:CPViewWidthSizable];
+
+    var scrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(0.0, 0.0, LEFT_PANEL_WIDTH, CGRectGetHeight(bounds))],
+        contentView = [scrollView contentView];
+
+    [scrollView setAutohidesScrollers:YES];
+    [scrollView setDocumentView:_themesCollectionView];
+
+    [contentView setBackgroundColor:[CPColor colorWithRed:212.0 / 255.0 green:221.0 / 255.0 blue:230.0 / 255.0 alpha:1.0]];
+    [contentView addSubview:label];
+
+    [splitView addSubview:scrollView];
+
+    // Right Pane
+    _themedObjectsCollectionView = [[CPCollectionView alloc] initWithFrame:CGRectMake(0.0, 0.0, CGRectGetWidth(bounds) - LEFT_PANEL_WIDTH - 1.0, 10.0)];
+
+    var collectionViewItem = [[CPCollectionViewItem alloc] init];
+
+    [collectionViewItem setView:[[BKShowcaseCell alloc] init]];
+
+    [_themedObjectsCollectionView setItemPrototype:collectionViewItem];
+    [_themedObjectsCollectionView setVerticalMargin:20.0];
+    [_themedObjectsCollectionView setAutoresizingMask:CPViewWidthSizable];
+
+    var scrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(LEFT_PANEL_WIDTH + 1.0, 0.0, CGRectGetWidth(bounds) - LEFT_PANEL_WIDTH - 1.0, CGRectGetHeight(bounds))];
+
+    [scrollView setHasHorizontalScroller:NO];
+    [scrollView setAutohidesScrollers:YES];
+    [scrollView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
+    [scrollView setDocumentView:_themedObjectsCollectionView];
+
+    [splitView addSubview:scrollView];
+
+    [_themesCollectionView setSelectionIndexes:[CPIndexSet indexSetWithIndex:0]];
+
+    [theWindow setFullBridge:YES];
+    [theWindow makeKeyAndOrderFront:self];
+}
+
+- (void)collectionViewDidChangeSelection:(CPCollectionView)aCollectionView
+{
+    var themeDescriptorClass = _themeDescriptorClasses[[[aCollectionView selectionIndexes] firstIndex]],
+        itemSize = [themeDescriptorClass itemSize];
+
+    // Make room for label and apply a minimum size.
+    itemSize.width = MAX(100.0, itemSize.width + 20.0);
+    itemSize.height = MAX(100.0, itemSize.height + 30.0);
+
+    [_themedObjectsCollectionView setMinItemSize:itemSize];
+    [_themedObjectsCollectionView setMaxItemSize:itemSize];
+
+    [_themedObjectsCollectionView setContent:[themeDescriptorClass themedObjectTemplates]];
+    [BKShowcaseCell setBackgroundColor:[themeDescriptorClass showcaseBackgroundColor]];
+}
+
+- (CPArray)toolbarAllowedItemIdentifiers:(CPToolbar)aToolbar
+{
+    return [CPToolbarSpaceItemIdentifier, CPToolbarFlexibleSpaceItemIdentifier, BKBackgroundColorToolbarItemIdentifier, BKStateToolbarItemIdentifier];
+}
+
+- (CPArray)toolbarDefaultItemIdentifiers:(CPToolbar)aToolbar
+{
+    return [CPToolbarFlexibleSpaceItemIdentifier, BKBackgroundColorToolbarItemIdentifier, BKStateToolbarItemIdentifier];
+}
+
+- (CPToolbarItem)toolbar:(CPToolbar)aToolbar itemForItemIdentifier:(CPString)anItemIdentifier willBeInsertedIntoToolbar:(BOOL)aFlag
+{
+    var toolbarItem = [[CPToolbarItem alloc] initWithItemIdentifier:anItemIdentifier];
+
+    [toolbarItem setTarget:self];
+
+    if (anItemIdentifier === BKStateToolbarItemIdentifier)
+    {
+        var popUpButton = [CPPopUpButton buttonWithTitle:@&quot;Enabled&quot;];
+
+        [popUpButton addItemWithTitle:@&quot;Disabled&quot;];
+
+        [toolbarItem setView:popUpButton];
+        [toolbarItem setTarget:nil];
+        [toolbarItem setAction:@selector(changeState:)];
+        [toolbarItem setLabel:@&quot;State&quot;];
+
+        var width = CGRectGetWidth([popUpButton frame]);
+
+        [toolbarItem setMinSize:CGSizeMake(width + 20.0, 32.0)];
+        [toolbarItem setMaxSize:CGSizeMake(width + 20.0, 32.0)];
+    }
     
-    for (; index &lt; count; ++index)
+    else if (BKBackgroundColorToolbarItemIdentifier)
+    {
+        var popUpButton = [CPPopUpButton buttonWithTitle:@&quot;Light Checkers&quot;];
+
+        [popUpButton addItemWithTitle:@&quot;Dark Checkers&quot;];
+        [popUpButton addItemWithTitle:@&quot;Window Background Color&quot;];
+        [popUpButton addItemWithTitle:@&quot;White&quot;];
+        [popUpButton addItemWithTitle:@&quot;Black&quot;];
+        [popUpButton addItemWithTitle:@&quot;More Choices...&quot;];
+
+        var itemArray = [popUpButton itemArray];
+
+        [itemArray[0] setRepresentedObject:[BKThemeDescriptor lightCheckersColor]];
+        [itemArray[1] setRepresentedObject:[BKThemeDescriptor darkCheckersColor]];
+        [itemArray[2] setRepresentedObject:[BKThemeDescriptor windowBackgroundColor]];
+        [itemArray[3] setRepresentedObject:[CPColor whiteColor]];
+        [itemArray[4] setRepresentedObject:[CPColor blackColor]];
+
+        [toolbarItem setView:popUpButton];
+        [toolbarItem setTarget:nil];
+        [toolbarItem setAction:@selector(changeColor:)];
+        [toolbarItem setLabel:@&quot;Background Color&quot;];
+
+        var width = CGRectGetWidth([popUpButton frame]);
+
+        [toolbarItem setMinSize:CGSizeMake(width, 32.0)];
+        [toolbarItem setMaxSize:CGSizeMake(width, 32.0)];
+    }
+
+    return toolbarItem;
+}
+
+- (BKThemeDescriptor)selectedThemeDescriptor
+{
+    return _themeDescriptorClasses[[[_themesCollectionView selectionIndexes] firstIndex]];
+}
+
+- (void)changeState:(id)aSender
+{
+    var themedObjectTemplates = [[self selectedThemeDescriptor] themedObjectTemplates],
+        count = [themedObjectTemplates count];
+
+    while (count--)
+    {
+        var themedObject = [themedObjectTemplates[count] valueForKey:@&quot;themedObject&quot;];
+
+        if ([themedObject respondsToSelector:@selector(setEnabled:)])
+            [themedObject setEnabled:[aSender title] === @&quot;Enabled&quot; ? YES : NO];
+    }
+}
+
+- (void)changeColor:(id)aSender
+{
+    var color = nil;
+
+    if ([aSender isKindOfClass:[CPColorPanel class]])
+        color = [aSender color];
+
+    else
     {
-        var theClass = themeDescriptorClasses[index],
-            item = [[CPTabViewItem alloc] initWithIdentifier:[theClass themeName]],
-            templates = BKThemeObjectTemplatesForClass(theClass),
-            templatesCount = [templates count],
-            viewTemplates = [],
-            itemSize = CGSizeMake(0.0, 0.0);
-            
-        while (templatesCount--)
+        if ([aSender titleOfSelectedItem] === @&quot;More Choices...&quot;)
         {
-            var template = templates[templatesCount],
-                object = [template valueForKey:@&quot;themedObject&quot;];
-
-            if ([object isKindOfClass:[CPView class]])
-            {            
-                var size = [object frame].size,
-                    labelWidth = [[template valueForKey:@&quot;label&quot;] sizeWithFont:[CPFont boldSystemFontOfSize:12.0]].width + 20.0;
-
-                if (size.width &gt; itemSize.width)
-                    itemSize.width = size.width;
-                    
-                if (labelWidth &gt; itemSize.width)
-                    itemSize.width = labelWidth;
-                
-                if (size.height &gt; itemSize.height)
-                    itemSize.height = size.height;
-                    
-                [viewTemplates addObject:template];
-            }
+            [aSender addItemWithTitle:@&quot;Other&quot;];
+            [aSender selectItemWithTitle:@&quot;Other&quot;];
+
+            [CPApp orderFrontColorPanel:self];
         }
-        
-        itemSize.width += 20.0;
-        itemSize.height += 30.0;
+        else
+        {
+            color = [[aSender selectedItem] representedObject];
 
-        var collectionView = [[CPCollectionView alloc] initWithFrame:CGRectMakeZero()],
-            collectionViewItem = [[CPCollectionViewItem alloc] init];
+            [aSender removeItemWithTitle:@&quot;Other&quot;];
+        }
+    }
 
-        var backgroundColor = nil;
+    if (color)
+    {
+        [[self selectedThemeDescriptor] setShowcaseBackgroundColor:color];
+        [BKShowcaseCell setBackgroundColor:color];
+    }
+}
 
-        if ([theClass respondsToSelector:@selector(themeShowcaseBackgroundColor)])
-            backgroundColor = [theClass themeShowcaseBackgroundColor];
+@end
 
-        [collectionViewItem setView:[[BKShowcaseCell alloc] initWithShowcaseBackgroundColor:backgroundColor]];
+var SelectionColor = nil;
 
-        [collectionView setItemPrototype:collectionViewItem];
-        [collectionView setMinItemSize:itemSize];
-        [collectionView setMaxItemSize:itemSize];
-        [collectionView setVerticalMargin:5.0];
-        [collectionView setContent:viewTemplates];
-        
-        [item setLabel:[theClass themeName]];
-        [item setView:collectionView];
+@implementation BKThemeDescriptorCell : CPView
+{
+    CPTextField _label;
+}
+
++ (CPImage)selectionColor
+{
+    if (!SelectionColor)
+        SelectionColor = [CPColor colorWithPatternImage:[[CPImage alloc] initWithContentsOfFile:[[CPBundle bundleForClass:[BKThemeDescriptorCell class]] pathForResource:@&quot;selection.png&quot;] size:CGSizeMake(1.0, 36.0)]];
+
+    return SelectionColor;
+}
 
-        [tabView addTabViewItem:item];
+- (void)setRepresentedObject:(id)aThemeDescriptor
+{
+    if (!_label)
+    {
+        _label = [CPTextField labelWithTitle:@&quot;hello&quot;];
+
+        [_label setFont:[CPFont systemFontOfSize:11.0]];
+        [_label setFrame:CGRectMake(10.0, 0.0, CGRectGetWidth([self bounds]) - 20.0, CGRectGetHeight([self bounds]))];
+
+        [_label setVerticalAlignment:CPCenterVerticalTextAlignment];
+        [_label setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
+
+        [self addSubview:_label];
     }
+    
+    [_label setStringValue:[aThemeDescriptor themeName] + &quot; (&quot; + [[aThemeDescriptor themedObjectTemplates] count] + &quot;)&quot;];
+}
 
-    [theWindow orderFront:self];
+- (void)setSelected:(BOOL)isSelected
+{
+    [self setBackgroundColor:isSelected ? [[self class] selectionColor] : nil];
+
+    [_label setTextShadowOffset:isSelected ? CGSizeMake(0.0, 1.0) : CGSizeMakeZero()];
+    [_label setTextShadowColor:isSelected ? [CPColor blackColor] : nil];
+    [_label setFont:isSelected ? [CPFont boldSystemFontOfSize:11.0] : [CPFont systemFontOfSize:11.0]];
+    [_label setTextColor:isSelected ? [CPColor whiteColor] : [CPColor blackColor]];
 }
 
 @end
 
 
+var ShowcaseCellBackgroundColor = nil;
+
+var BKShowcaseCellBackgroundColorDidChangeNotification  = @&quot;BKShowcaseCellBackgroundColorDidChangeNotification&quot;;
+
 @implementation BKShowcaseCell : CPView
 {
-    CPColor     _showcaseBackgroundColor;
     CPView      _backgroundView;
 
     CPView      _view;
     CPTextField _label;
 }
 
-- (id)initWithShowcaseBackgroundColor:(CPColor)aColor
++ (void)setBackgroundColor:(CPColor)aColor
+{
+    if (ShowcaseCellBackgroundColor === aColor)
+        return;
+
+    ShowcaseCellBackgroundColor = aColor;
+
+    [[CPNotificationCenter defaultCenter]
+        postNotificationName:BKShowcaseCellBackgroundColorDidChangeNotification
+                      object:nil];
+}
+
++ (CPColor)backgroundColor
+{
+    return ShowcaseCellBackgroundColor;
+}
+
+- (id)init
 {
     self = [super init];
 
     if (self)
-        _showcaseBackgroundColor = aColor;
+        [[CPNotificationCenter defaultCenter]
+            addObserver:self
+               selector:@selector(showcaseBackgroundDidChange:)
+                   name:BKShowcaseCellBackgroundColorDidChangeNotification
+                 object:nil];
 
     return self;
 }
 
+- (id)initWithCoder:(CPCoder)aCoder
+{
+    self = [super initWithCoder:aCoder];
+    
+    if (self)
+        [[CPNotificationCenter defaultCenter]
+            addObserver:self
+               selector:@selector(showcaseBackgroundDidChange:)
+                   name:BKShowcaseCellBackgroundColorDidChangeNotification
+                 object:nil];
+
+    return self;
+}
+
+- (void)showcaseBackgroundDidChange:(CPNotification)aNotification
+{
+    [_backgroundView setBackgroundColor:[BKShowcaseCell backgroundColor]];
+}
+
 - (void)setSelected:(BOOL)isSelected
 {
 }
@@ -116,26 +352,24 @@
     if (!_label)
     {
         _label = [[CPTextField alloc] initWithFrame:CGRectMakeZero()];
-        
+
         [_label setAlignment:CPCenterTextAlignment];
         [_label setAutoresizingMask:CPViewMinYMargin | CPViewWidthSizable];
-        [_label setFont:[CPFont boldSystemFontOfSize:12.0]];
-        
+        [_label setFont:[CPFont boldSystemFontOfSize:11.0]];
+
         [self addSubview:_label];
     }
-    
+
     [_label setStringValue:[anObject valueForKey:@&quot;label&quot;]];
     [_label sizeToFit];
-    
+
     [_label setFrame:CGRectMake(0.0, CGRectGetHeight([self bounds]) - CGRectGetHeight([_label frame]), 
         CGRectGetWidth([self bounds]), CGRectGetHeight([_label frame]))];
-    
+
     if (!_backgroundView)
     {
         _backgroundView = [[CPView alloc] init];
 
-        [_backgroundView setBackgroundColor:_showcaseBackgroundColor];
-
         [self addSubview:_backgroundView];
     }
 
@@ -153,23 +387,7 @@
         (CGRectGetHeight([_backgroundView bounds]) - CGRectGetHeight([_view frame])) / 2.0)];
 
     [_backgroundView addSubview:_view];
-}
-
-- (id)initWithCoder:(CPCoder)aCoder
-{
-    self = [super initWithCoder:aCoder];
-
-    if (self)
-        _showcaseBackgroundColor = [aCoder decodeObjectForKey:@&quot;showcase-background-color&quot;];
-
-    return self
-}
-
-- (void)encodeWithCoder:(CPCoder)aCoder
-{
-    [super encodeWithCoder:aCoder];
-
-    [aCoder encodeObject:_showcaseBackgroundColor forKey:@&quot;showcase-background-color&quot;];
+    [_backgroundView setBackgroundColor:[BKShowcaseCell backgroundColor]];
 }
 
 @end</diff>
      <filename>AppKit/Tools/BlendKit/BKShowcaseController.j</filename>
    </modified>
    <modified>
      <diff>@@ -52,94 +52,3 @@
 }
 
 @end
-
-function BKThemeDescriptorClasses()
-{
-    // Grab Theme Descriptor Classes.
-    var themeDescriptorClasses = [];
-    
-    for (candidate in window)
-    {
-        var theClass = objj_getClass(candidate),
-            theClassName = class_getName(theClass),
-            index = theClassName.indexOf(&quot;ThemeDescriptor&quot;);
-        
-        if ((index &gt;= 0) &amp;&amp; (index === theClassName.length - &quot;ThemeDescriptor&quot;.length))
-            themeDescriptorClasses.push(theClass);
-    }
-    
-    return themeDescriptorClasses;
-}
-
-function BKThemeObjectTemplatesForClass(aClass)
-{
-    var templates = [],
-        methods = class_copyMethodList(aClass.isa),
-        count = [methods count];
-
-    while (count--)
-    {
-        var method = methods[count],
-            selector = method_getName(method);
-    
-        if (selector.indexOf(&quot;themed&quot;) === 0)
-        {
-            var impl = method_getImplementation(method),
-                object = impl(aClass, selector);
-            
-            if (object)
-            {
-                var template = [[BKThemeObjectTemplate alloc] init];
-
-                [template setValue:object forKey:@&quot;themedObject&quot;];
-                [template setValue:BKLabelFromIdentifier(selector) forKey:@&quot;label&quot;];
-                
-                [templates addObject:template];
-            }
-        }
-    }
-    
-    return templates;
-}
-
-function BKLabelFromIdentifier(anIdentifier)
-{
-    var string = anIdentifier.substr(&quot;themed&quot;.length);
-        index = 0,
-        count = string.length,
-        label = &quot;&quot;,
-        lastCapital = null,
-        isLeadingCapital = YES;
-    
-    for (; index &lt; count; ++index)
-    {
-        var character = string.charAt(index),
-            isCapital = /^[A-Z]/.test(character);
-        
-        if (isCapital)
-        {        
-            if (!isLeadingCapital)
-            {
-                if (lastCapital === null)
-                    label += ' ' + character.toLowerCase();
-                else
-                    label += character;
-            }
-            
-            lastCapital = character;
-        }
-        else
-        {
-            if (isLeadingCapital &amp;&amp; lastCapital !== null)
-                label += lastCapital;
-                
-            label += character;
-            
-            lastCapital = null;
-            isLeadingCapital = NO;
-        }
-    }
-    
-    return label;
-}
-</diff>
      <filename>AppKit/Tools/BlendKit/BKUtilities.j</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,4 @@
 
 @import &quot;BKShowcaseController.j&quot;
+@import &quot;BKThemeDescriptor.j&quot;
 @import &quot;BKUtilities.j&quot;</diff>
      <filename>AppKit/Tools/BlendKit/BlendKit.j</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>15bff97388c48460f540e632940a7d6ac47d55ba</id>
    </parent>
  </parents>
  <author>
    <name>Francisco Ryan Tolmasky I</name>
    <email>francisco@280north.com</email>
  </author>
  <url>http://github.com/280north/cappuccino/commit/aebbdbe0a335a7ae8b7bbeb5cc7f39062482d4b0</url>
  <id>aebbdbe0a335a7ae8b7bbeb5cc7f39062482d4b0</id>
  <committed-date>2009-05-23T12:33:24-07:00</committed-date>
  <authored-date>2009-05-23T12:33:24-07:00</authored-date>
  <message>Fixed a few graphics bugs and made the automatically generated theme gallery nicer.

Reviewed by me.</message>
  <tree>cc2597dfddf2a7af6e29ddf44f836eebc353e08b</tree>
  <committer>
    <name>Francisco Ryan Tolmasky I</name>
    <email>francisco@280north.com</email>
  </committer>
</commit>
