mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
CPSplitView is now fully themable
This commit is contained in:
+12
-21
@@ -51,10 +51,7 @@
|
||||
CPSplitViewDidResizeSubviewsNotification = @"CPSplitViewDidResizeSubviewsNotification";
|
||||
CPSplitViewWillResizeSubviewsNotification = @"CPSplitViewWillResizeSubviewsNotification";
|
||||
|
||||
var CPSplitViewHorizontalImage = nil,
|
||||
CPSplitViewVerticalImage = nil,
|
||||
|
||||
ShouldSuppressResizeNotifications = 1,
|
||||
var ShouldSuppressResizeNotifications = 1,
|
||||
DidPostWillResizeNotification = 1 << 1,
|
||||
DidSuppressResizeNotification = 1 << 2;
|
||||
|
||||
@@ -104,22 +101,16 @@ var CPSplitViewHorizontalImage = nil,
|
||||
|
||||
+ (id)themeAttributes
|
||||
{
|
||||
return [CPDictionary dictionaryWithObjects:[1.0, 10.0, [CPColor grayColor]]
|
||||
forKeys:[@"divider-thickness", @"pane-divider-thickness", @"pane-divider-color"]];
|
||||
}
|
||||
|
||||
/*
|
||||
@ignore
|
||||
*/
|
||||
+ (void)initialize
|
||||
{
|
||||
if (self !== [CPSplitView class])
|
||||
return;
|
||||
|
||||
var bundle = [CPBundle bundleForClass:self];
|
||||
|
||||
CPSplitViewHorizontalImage = CPImageInBundle("CPSplitView/CPSplitViewHorizontal.png", CGSizeMake(5.0, 10.0), bundle);
|
||||
CPSplitViewVerticalImage = CPImageInBundle("CPSplitView/CPSplitViewVertical.png", CGSizeMake(10.0, 5.0), bundle);
|
||||
return [CPDictionary dictionaryWithObjects:[ 1.0,
|
||||
10.0,
|
||||
[CPColor grayColor],
|
||||
[CPNull null],
|
||||
[CPNull null]]
|
||||
forKeys:[ @"divider-thickness",
|
||||
@"pane-divider-thickness",
|
||||
@"pane-divider-color",
|
||||
@"horizontal-divider-color",
|
||||
@"vertical-divider-color"]];
|
||||
}
|
||||
|
||||
- (id)initWithFrame:(CGRect)aFrame
|
||||
@@ -202,7 +193,7 @@ var CPSplitViewHorizontalImage = nil,
|
||||
|
||||
_originComponent = [self isVertical] ? "x" : "y";
|
||||
_sizeComponent = [self isVertical] ? "width" : "height";
|
||||
_dividerImagePath = [self isVertical] ? [CPSplitViewVerticalImage filename] : [CPSplitViewHorizontalImage filename];
|
||||
_dividerImagePath = [self isVertical] ? [[self valueForThemeAttribute:@"vertical-divider-color"] filename] : [[self valueForThemeAttribute:@"horizontal-divider-color"] filename];
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user