diff --git a/AppKit/CPColor.j b/AppKit/CPColor.j index 0e59f5ba2..4a24bc8e2 100644 --- a/AppKit/CPColor.j +++ b/AppKit/CPColor.j @@ -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 */ diff --git a/AppKit/Themes/Aristo/ThemeDescriptors.j b/AppKit/Themes/Aristo/ThemeDescriptors.j index 31bd445ac..6902f92c7 100755 --- a/AppKit/Themes/Aristo/ThemeDescriptors.j +++ b/AppKit/Themes/Aristo/ThemeDescriptors.j @@ -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]; diff --git a/AppKit/Themes/Aristo2/ThemeDescriptors.j b/AppKit/Themes/Aristo2/ThemeDescriptors.j index ee6917791..365cadba0 100644 --- a/AppKit/Themes/Aristo2/ThemeDescriptors.j +++ b/AppKit/Themes/Aristo2/ThemeDescriptors.j @@ -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]; diff --git a/Tests/Manual/CPTextView/AppController.j b/Tests/Manual/CPTextView/AppController.j index 4cdfc6305..e9e1d6ed7 100755 --- a/Tests/Manual/CPTextView/AppController.j +++ b/Tests/Manual/CPTextView/AppController.j @@ -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]; //