Revision: 24148
          http://sourceforge.net/p/bibdesk/svn/24148
Author:   hofman
Date:     2019-08-18 21:16:17 +0000 (Sun, 18 Aug 2019)
Log Message:
-----------
make search highlight color in preview transparent

Modified Paths:
--------------
    trunk/bibdesk/NSColor_BDSKExtensions.h
    trunk/bibdesk/NSColor_BDSKExtensions.m
    trunk/bibdesk/NSTextView_BDSKExtensions.m

Modified: trunk/bibdesk/NSColor_BDSKExtensions.h
===================================================================
--- trunk/bibdesk/NSColor_BDSKExtensions.h      2019-08-18 06:32:02 UTC (rev 
24147)
+++ trunk/bibdesk/NSColor_BDSKExtensions.h      2019-08-18 21:16:17 UTC (rev 
24148)
@@ -59,6 +59,8 @@
 + (NSColor *)complexStringColorInherited:(BOOL)isInherited 
selected:(BOOL)isSelected;
 + (NSColor *)inheritedStringColorSelected:(BOOL)isSelected;
 
++ (NSColor *)searchHighlightColor;
+
 + (NSColor *)colorWithFourByteString:(NSString *)string;
 - (id)fourByteStringValue;
 

Modified: trunk/bibdesk/NSColor_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSColor_BDSKExtensions.m      2019-08-18 06:32:02 UTC (rev 
24147)
+++ trunk/bibdesk/NSColor_BDSKExtensions.m      2019-08-18 21:16:17 UTC (rev 
24148)
@@ -249,6 +249,19 @@
     return colors[i];
 }
 
++ (NSColor *)searchHighlightColor {
+    static NSColor *color = nil;
+    if (color == nil) {
+        if (RUNNING_BEFORE(10_13))
+            color = [[[NSColor systemYellowColor] 
colorWithAlphaComponent:0.33333] retain];
+        else
+            color = [[BDSKGeneratedDynamicColor alloc] 
initWithColorGenerator:^{
+                return [[NSColor systemYellowColor] 
colorWithAlphaComponent:0.33333];
+            }];
+    }
+    return color;
+}
+
 typedef union _BDSKRGBAInt {
     struct {
         uint8_t r;

Modified: trunk/bibdesk/NSTextView_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSTextView_BDSKExtensions.m   2019-08-18 06:32:02 UTC (rev 
24147)
+++ trunk/bibdesk/NSTextView_BDSKExtensions.m   2019-08-18 21:16:17 UTC (rev 
24148)
@@ -132,7 +132,7 @@
     NSUInteger length = [string length];
     
     // Mail.app appears to use a light gray highlight, which is rather ugly, 
but we don't want to use the selected text highlight
-    NSDictionary *highlightAttributes = [NSDictionary 
dictionaryWithObjectsAndKeys:[NSColor systemYellowColor], 
NSBackgroundColorAttributeName, nil];
+    NSDictionary *highlightAttributes = [NSDictionary 
dictionaryWithObjectsAndKeys:[NSColor searchHighlightColor], 
NSBackgroundColorAttributeName, nil];
     
     // use the layout manager to add temporary attributes; the advantage for 
our purpose is that temporary attributes don't print
     NSLayoutManager *layoutManager = [self layoutManager];

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to