move selection color to the themes

This commit is contained in:
daboe01
2016-05-12 20:17:14 +02:00
parent df71fb42ac
commit b3306d50eb
4 changed files with 25 additions and 18 deletions
+6 -4
View File
@@ -100,8 +100,10 @@ var cachedBlackColor,
+ (CPDictionary)themeAttributes
{
return @{
@"alternate-selected-control-color": [CPNull null],
@"secondary-selected-control-color" : [CPNull null]
@"alternate-selected-control-color": [CPNull null],
@"secondary-selected-control-color": [CPNull null],
@"selected-text-background-color": [CPNull null],
@"selected-text-inactive-background-color": [CPNull null]
};
}
@@ -500,12 +502,12 @@ var cachedBlackColor,
+ (CPColor)selectedTextBackgroundColor
{
return [CPColor colorWithHexString:"99CCFF"];
return [[self _cachedThemeColor] valueForThemeAttribute:@"selected-text-background-color"];
}
+ (CPColor)_selectedTextBackgroundColorUnfocussed
{
return [CPColor colorWithHexString:"CCCCCC"];
return [[self _cachedThemeColor] valueForThemeAttribute:@"selected-text-inactive-background-color"];
}
/* @ignore */
+5 -2
View File
@@ -389,8 +389,11 @@ var themedButtonValues = nil,
var color = [CPColor blackColor],
themedColorValues =
[
[@"alternate-selected-control-color", [[CPColor alloc] _initWithRGBA:[0.22, 0.46, 0.84, 1.0]]],
[@"secondary-selected-control-color", [[CPColor alloc] _initWithRGBA:[0.83, 0.83, 0.83, 1.0]]]
[@"alternate-selected-control-color", [[CPColor alloc] _initWithRGBA:[0.22, 0.46, 0.84, 1.0]]],
[@"secondary-selected-control-color", [[CPColor alloc] _initWithRGBA:[0.83, 0.83, 0.83, 1.0]]],
[@"selected-text-background-color", [CPColor colorWithHexString:"99CCFF"]],
[@"selected-text-inactive-background-color", [CPColor colorWithHexString:"CCCCCC"]]
];
[self registerThemeValues:themedColorValues forObject:color];
+4 -2
View File
@@ -106,8 +106,10 @@ var themedButtonValues = nil,
var color = [CPColor redColor],
themedColorValues =
[
[@"alternate-selected-control-color", [[CPColor alloc] _initWithRGBA:[0.22, 0.46, 0.84, 1.0]]],
[@"secondary-selected-control-color", [[CPColor alloc] _initWithRGBA:[0.83, 0.83, 0.83, 1.0]]]
[@"alternate-selected-control-color", [[CPColor alloc] _initWithRGBA:[0.22, 0.46, 0.84, 1.0]]],
[@"secondary-selected-control-color", [[CPColor alloc] _initWithRGBA:[0.83, 0.83, 0.83, 1.0]]],
[@"selected-text-background-color", [CPColor colorWithHexString:"99CCFF"]],
[@"selected-text-inactive-background-color", [CPColor colorWithHexString:"CCCCCC"]]
];
[self registerThemeValues:themedColorValues forObject:color];
+10 -10
View File
@@ -32,19 +32,19 @@
_textView = [[CPTextView alloc] initWithFrame:CGRectMake(0,0,500,500)];
[_textView setRichText:YES];
// _textView2 = [[CPTextView alloc] initWithFrame:CGRectMake(0,0,500,500)];
// _textView2._isRichText = NO;
// [_textView setBackgroundColor:[CPColor whiteColor]];
// [_textView2 setBackgroundColor:[CPColor whiteColor]];
//
_textView2 = [[CPTextView alloc] initWithFrame:CGRectMake(0,0,500,500)];
_textView2._isRichText = NO;
[_textView setBackgroundColor:[CPColor whiteColor]];
[_textView2 setBackgroundColor:[CPColor whiteColor]];
var scrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(20, 20,520,510)];
// var scrollView2 = [[CPScrollView alloc] initWithFrame:CGRectMake(560, 20,520,510)];
// // [scrollView setAutohidesScrollers:YES];
var scrollView2 = [[CPScrollView alloc] initWithFrame:CGRectMake(560, 20,520,510)];
// [scrollView setAutohidesScrollers:YES];
[scrollView setDocumentView:_textView];
// [scrollView2 setDocumentView:_textView2];
//
[scrollView2 setDocumentView:_textView2];
//
[contentView addSubview: scrollView];
// [contentView addSubview: scrollView2];
[contentView addSubview: scrollView2];
//
// [_textView setDelegate:self];
//