Merge branch 'Aristo2' of github.mv.usa.alcatel.com:amercada/Cappuccino into Aristo2
@@ -94,7 +94,7 @@
|
||||
domain = "";
|
||||
|
||||
#if PLATFORM(DOM)
|
||||
document.cookie = _cookieName+"="+value+expires+"; path=/"+domain;
|
||||
document.cookie = _cookieName + "=" + value + expires + "; path=/" + domain;
|
||||
#else
|
||||
_cookieValue = value;
|
||||
_expires = expires;
|
||||
|
||||
@@ -32,14 +32,6 @@ CPContinuousCapacityLevelIndicatorStyle = 1;
|
||||
CPDiscreteCapacityLevelIndicatorStyle = 2;
|
||||
CPRatingLevelIndicatorStyle = 3;
|
||||
|
||||
var _CPLevelIndicatorBezelColor = nil,
|
||||
_CPLevelIndicatorSegmentEmptyColor = nil,
|
||||
_CPLevelIndicatorSegmentNormalColor = nil,
|
||||
_CPLevelIndicatorSegmentWarningColor = nil,
|
||||
_CPLevelIndicatorSegmentCriticalColor = nil,
|
||||
|
||||
_CPLevelIndicatorSpacing = 1;
|
||||
|
||||
/*!
|
||||
@ingroup appkit
|
||||
@class CPLevelIndicator
|
||||
@@ -62,59 +54,23 @@ var _CPLevelIndicatorBezelColor = nil,
|
||||
BOOL _isTracking;
|
||||
}
|
||||
|
||||
+ (void)initialize
|
||||
+ (CPString)defaultThemeClass
|
||||
{
|
||||
if (self !== [CPLevelIndicator class])
|
||||
return;
|
||||
|
||||
var bundle = [CPBundle bundleForClass:CPLevelIndicator];
|
||||
|
||||
_CPLevelIndicatorBezelColor = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:
|
||||
[
|
||||
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPLevelIndicator/level-indicator-bezel-left.png"] size:CGSizeMake(3.0, 18.0)],
|
||||
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPLevelIndicator/level-indicator-bezel-center.png"] size:CGSizeMake(1.0, 18.0)],
|
||||
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPLevelIndicator/level-indicator-bezel-right.png"] size:CGSizeMake(3.0, 18.0)]
|
||||
]
|
||||
isVertical:NO
|
||||
]];
|
||||
|
||||
_CPLevelIndicatorSegmentEmptyColor = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:
|
||||
[
|
||||
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPLevelIndicator/level-indicator-segment-empty-left.png"] size:CGSizeMake(3.0, 17.0)],
|
||||
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPLevelIndicator/level-indicator-segment-empty-center.png"] size:CGSizeMake(1.0, 17.0)],
|
||||
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPLevelIndicator/level-indicator-segment-empty-right.png"] size:CGSizeMake(3.0, 17.0)]
|
||||
]
|
||||
isVertical:NO
|
||||
]];
|
||||
|
||||
_CPLevelIndicatorSegmentNormalColor = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:
|
||||
[
|
||||
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPLevelIndicator/level-indicator-segment-normal-left.png"] size:CGSizeMake(3.0, 17.0)],
|
||||
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPLevelIndicator/level-indicator-segment-normal-center.png"] size:CGSizeMake(1.0, 17.0)],
|
||||
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPLevelIndicator/level-indicator-segment-normal-right.png"] size:CGSizeMake(3.0, 17.0)]
|
||||
]
|
||||
isVertical:NO
|
||||
]];
|
||||
|
||||
_CPLevelIndicatorSegmentWarningColor = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:
|
||||
[
|
||||
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPLevelIndicator/level-indicator-segment-warning-left.png"] size:CGSizeMake(3.0, 17.0)],
|
||||
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPLevelIndicator/level-indicator-segment-warning-center.png"] size:CGSizeMake(1.0, 17.0)],
|
||||
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPLevelIndicator/level-indicator-segment-warning-right.png"] size:CGSizeMake(3.0, 17.0)]
|
||||
]
|
||||
isVertical:NO
|
||||
]];
|
||||
|
||||
_CPLevelIndicatorSegmentCriticalColor = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:
|
||||
[
|
||||
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPLevelIndicator/level-indicator-segment-critical-left.png"] size:CGSizeMake(3.0, 17.0)],
|
||||
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPLevelIndicator/level-indicator-segment-critical-center.png"] size:CGSizeMake(1.0, 17.0)],
|
||||
[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPLevelIndicator/level-indicator-segment-critical-right.png"] size:CGSizeMake(3.0, 17.0)]
|
||||
]
|
||||
isVertical:NO
|
||||
]];
|
||||
return "level-indicator";
|
||||
}
|
||||
|
||||
+ (id)themeAttributes
|
||||
{
|
||||
return [CPDictionary dictionaryWithObjectsAndKeys: [CPNull null], @"bezel-color",
|
||||
[CPNull null], @"color-empty",
|
||||
[CPNull null], @"color-normal",
|
||||
[CPNull null], @"color-warning",
|
||||
[CPNull null], @"color-critical",
|
||||
1.0, @"spacing"];
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (id)initWithFrame:(CGRect)aFrame
|
||||
{
|
||||
self = [super initWithFrame:aFrame];
|
||||
@@ -142,20 +98,20 @@ var _CPLevelIndicatorBezelColor = nil,
|
||||
positioned:CPWindowBelow
|
||||
relativeToEphemeralSubviewNamed:nil];
|
||||
// TODO Make themable.
|
||||
[bezelView setBackgroundColor:_CPLevelIndicatorBezelColor];
|
||||
[bezelView setBackgroundColor:[self valueForThemeAttribute:@"bezel-color"]];
|
||||
|
||||
var segmentCount = _maxValue - _minValue;
|
||||
|
||||
if (segmentCount <= 0)
|
||||
return;
|
||||
|
||||
var filledColor = _CPLevelIndicatorSegmentNormalColor,
|
||||
var filledColor = [self valueForThemeAttribute:@"color-normal"],
|
||||
value = [self doubleValue];
|
||||
|
||||
if (value <= _criticalValue)
|
||||
filledColor = _CPLevelIndicatorSegmentCriticalColor;
|
||||
filledColor = [self valueForThemeAttribute:@"color-critical"];
|
||||
else if (value <= _warningValue)
|
||||
filledColor = _CPLevelIndicatorSegmentWarningColor;
|
||||
filledColor = [self valueForThemeAttribute:@"color-warning"];
|
||||
|
||||
for (var i = 0; i < segmentCount; i++)
|
||||
{
|
||||
@@ -163,7 +119,7 @@ var _CPLevelIndicatorBezelColor = nil,
|
||||
positioned:CPWindowAbove
|
||||
relativeToEphemeralSubviewNamed:bezelView];
|
||||
|
||||
[segmentView setBackgroundColor:(_minValue + i) < value ? filledColor : _CPLevelIndicatorSegmentEmptyColor];
|
||||
[segmentView setBackgroundColor:(_minValue + i) < value ? filledColor : [self valueForThemeAttribute:@"color-empty"]];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,11 +150,12 @@ var _CPLevelIndicatorBezelColor = nil,
|
||||
return _CGRectMakeZero();
|
||||
|
||||
var basicSegmentWidth = bounds.size.width / segmentCount,
|
||||
segmentFrame = CGRectCreateCopy([self bounds]);
|
||||
segmentFrame = CGRectCreateCopy([self bounds]),
|
||||
spacing = [self valueForThemeAttribute:@"spacing"];
|
||||
|
||||
segmentFrame.origin.y = (_CGRectGetHeight(bounds) - bezelHeight) / 2.0;
|
||||
segmentFrame.origin.x = FLOOR(segment * basicSegmentWidth);
|
||||
segmentFrame.size.width = (segment == segmentCount - 1) ? bounds.size.width - segmentFrame.origin.x : FLOOR(((segment + 1) * basicSegmentWidth)) - FLOOR((segment * basicSegmentWidth)) - _CPLevelIndicatorSpacing;
|
||||
segmentFrame.size.width = (segment == segmentCount - 1) ? bounds.size.width - segmentFrame.origin.x : FLOOR(((segment + 1) * basicSegmentWidth)) - FLOOR((segment * basicSegmentWidth)) - spacing;
|
||||
segmentFrame.size.height = segmentHeight;
|
||||
|
||||
return segmentFrame;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Copyright (c) 2011 Pear, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
@import @"CPPopUpButton.j"
|
||||
@import "CPPopUpButton.j"
|
||||
|
||||
var GRADIENT_START_COLOR = "#fcfcfc",
|
||||
GRADIENT_END_COLOR = "#dfdfdf",
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 218 B |
|
Before Width: | Height: | Size: 123 B |
|
Before Width: | Height: | Size: 213 B |
|
Before Width: | Height: | Size: 205 B |
|
Before Width: | Height: | Size: 120 B |
|
Before Width: | Height: | Size: 205 B |
|
Before Width: | Height: | Size: 142 B |
|
Before Width: | Height: | Size: 88 B |
|
Before Width: | Height: | Size: 137 B |
|
Before Width: | Height: | Size: 140 B |
|
Before Width: | Height: | Size: 89 B |
|
Before Width: | Height: | Size: 140 B |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 75 B After Width: | Height: | Size: 75 B |
|
Before Width: | Height: | Size: 106 B After Width: | Height: | Size: 106 B |
|
Before Width: | Height: | Size: 108 B After Width: | Height: | Size: 108 B |
|
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 143 B |
|
Before Width: | Height: | Size: 172 B After Width: | Height: | Size: 172 B |
|
Before Width: | Height: | Size: 194 B After Width: | Height: | Size: 194 B |
|
Before Width: | Height: | Size: 108 B After Width: | Height: | Size: 108 B |
|
Before Width: | Height: | Size: 126 B After Width: | Height: | Size: 126 B |
|
Before Width: | Height: | Size: 131 B After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 146 B After Width: | Height: | Size: 146 B |
|
Before Width: | Height: | Size: 173 B After Width: | Height: | Size: 173 B |
|
Before Width: | Height: | Size: 195 B After Width: | Height: | Size: 195 B |
|
Before Width: | Height: | Size: 147 B After Width: | Height: | Size: 147 B |
|
Before Width: | Height: | Size: 172 B After Width: | Height: | Size: 172 B |
|
Before Width: | Height: | Size: 189 B After Width: | Height: | Size: 189 B |
|
Before Width: | Height: | Size: 86 B After Width: | Height: | Size: 86 B |
|
Before Width: | Height: | Size: 79 B After Width: | Height: | Size: 79 B |
@@ -1332,6 +1332,8 @@ var themedButtonValues = nil,
|
||||
[splitView addSubview:leftView];
|
||||
[splitView addSubview:rightView];
|
||||
|
||||
var horizontalDividerColor = PatternImage("splitview-divider-horizontal.png", 5.0, 10.0),
|
||||
verticalDividerColor = PatternImage("splitview-divider-vertical.png", 10.0, 5.0);
|
||||
|
||||
[splitView setIsPaneSplitter:YES];
|
||||
|
||||
@@ -1339,7 +1341,9 @@ var themedButtonValues = nil,
|
||||
[
|
||||
[@"divider-thickness", 1.0],
|
||||
[@"pane-divider-thickness", 10.0],
|
||||
[@"pane-divider-color", [CPColor colorWithRed:165.0 / 255.0 green:165.0 / 255.0 blue:165.0 / 255.0 alpha:1.0]]
|
||||
[@"pane-divider-color", [CPColor colorWithRed:165.0 / 255.0 green:165.0 / 255.0 blue:165.0 / 255.0 alpha:1.0]],
|
||||
[@"horizontal-divider-color", horizontalDividerColor],
|
||||
[@"vertical-divider-color", verticalDividerColor]
|
||||
];
|
||||
|
||||
[self registerThemeValues:themedSplitViewValues forView:splitView];
|
||||
@@ -1718,6 +1722,61 @@ var themedButtonValues = nil,
|
||||
return box;
|
||||
}
|
||||
|
||||
+ (CPLevelIndicator)themedLevelIndicator
|
||||
{
|
||||
var levelIndicator = [[CPLevelIndicator alloc] initWithFrame:CGRectMake(0,0,100,100)],
|
||||
|
||||
bezelColor = PatternColor(
|
||||
[
|
||||
[@"level-indicator-bezel-left.png", 3.0, 18.0],
|
||||
[@"level-indicator-bezel-center.png", 1.0, 18.0],
|
||||
[@"level-indicator-bezel-right.png", 3.0, 18.0]
|
||||
]),
|
||||
|
||||
emptyColor = PatternColor(
|
||||
[
|
||||
[@"level-indicator-segment-empty-left.png", 3.0, 17.0],
|
||||
[@"level-indicator-segment-empty-center.png", 1.0, 17.0],
|
||||
[@"level-indicator-segment-empty-right.png", 3.0, 17.0]
|
||||
]),
|
||||
|
||||
normalColor = PatternColor(
|
||||
[
|
||||
[@"level-indicator-segment-normal-left.png", 3.0, 17.0],
|
||||
[@"level-indicator-segment-normal-center.png", 1.0, 17.0],
|
||||
[@"level-indicator-segment-normal-right.png", 3.0, 17.0]
|
||||
]),
|
||||
|
||||
warningColor = PatternColor(
|
||||
[
|
||||
[@"level-indicator-segment-warning-left.png", 3.0, 17.0],
|
||||
[@"level-indicator-segment-warning-center.png", 1.0, 17.0],
|
||||
[@"level-indicator-segment-warning-right.png", 3.0, 17.0]
|
||||
]),
|
||||
|
||||
criticalColor = PatternColor(
|
||||
[
|
||||
[@"level-indicator-segment-critical-left.png", 3.0, 17.0],
|
||||
[@"level-indicator-segment-critical-center.png", 1.0, 17.0],
|
||||
[@"level-indicator-segment-critical-right.png", 3.0, 17.0]
|
||||
]);
|
||||
|
||||
|
||||
themeValues =
|
||||
[
|
||||
[@"bezel-color", bezelColor],
|
||||
[@"color-empty", emptyColor],
|
||||
[@"color-normal", normalColor],
|
||||
[@"color-warning", warningColor],
|
||||
[@"color-critical", criticalColor],
|
||||
[@"spacing", 1.0]
|
||||
];
|
||||
|
||||
[self registerThemeValues:themeValues forView:levelIndicator];
|
||||
|
||||
return levelIndicator;
|
||||
}
|
||||
|
||||
|
||||
+ (_CPHUDWindowView)themedHUDWindowView
|
||||
{
|
||||
|
||||