mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Don’t set foreground color for (file) chooser items
Initially not-matched characters were made light gray and we also had to explicitly set the color to white when the item was highlighted. We no longer use color distinction for matched/non-matched characters, and rendering the text as highlighted is handled by the table view (NSCell setup).
This commit is contained in:
@@ -647,15 +647,7 @@ inline void rank_record (document_record_t& record, filter_string_t const& filte
|
||||
path += " — " + text::join(v, "/");
|
||||
}
|
||||
|
||||
NSColor* textColor = [NSColor controlTextColor];
|
||||
NSColor* matchedTextColor = [NSColor controlTextColor];
|
||||
if([aTableView isRowSelected:rowIndex] && [self.window isKeyWindow])
|
||||
{
|
||||
textColor = [NSColor alternateSelectedControlTextColor];
|
||||
matchedTextColor = [NSColor alternateSelectedControlTextColor];
|
||||
}
|
||||
|
||||
NSMutableAttributedString* str = CreateAttributedStringWithMarkedUpRanges(OakControlFont(), textColor, matchedTextColor, path, record.cover);
|
||||
NSMutableAttributedString* str = CreateAttributedStringWithMarkedUpRanges(path, record.cover);
|
||||
NSMutableParagraphStyle* pStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
|
||||
[pStyle setLineBreakMode:NSLineBreakByTruncatingMiddle];
|
||||
[str addAttribute:NSParagraphStyleAttributeName value:pStyle range:NSMakeRange(0, str.length)];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <oak/misc.h>
|
||||
|
||||
NSMutableAttributedString* CreateAttributedStringWithMarkedUpRanges (NSFont* baseFont, NSColor* textColor, NSColor* matchedTextColor, std::string const& in, std::vector< std::pair<size_t, size_t> > const& ranges, size_t offset = 0);
|
||||
NSMutableAttributedString* CreateAttributedStringWithMarkedUpRanges (std::string const& in, std::vector< std::pair<size_t, size_t> > const& ranges, size_t offset = 0);
|
||||
|
||||
PUBLIC @interface OakChooser : NSObject
|
||||
@property (nonatomic) NSWindow* window;
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
#import <ns/ns.h>
|
||||
#import <text/ranker.h>
|
||||
|
||||
NSMutableAttributedString* CreateAttributedStringWithMarkedUpRanges (NSFont* baseFont, NSColor* textColor, NSColor* matchedTextColor, std::string const& in, std::vector< std::pair<size_t, size_t> > const& ranges, size_t offset)
|
||||
NSMutableAttributedString* CreateAttributedStringWithMarkedUpRanges (std::string const& in, std::vector< std::pair<size_t, size_t> > const& ranges, size_t offset)
|
||||
{
|
||||
NSDictionary* baseAttributes = @{ NSForegroundColorAttributeName : textColor, };
|
||||
NSDictionary* highlightAttributes = @{ NSForegroundColorAttributeName : matchedTextColor, NSUnderlineStyleAttributeName : @1 };
|
||||
NSDictionary* baseAttributes = @{ };
|
||||
NSDictionary* highlightAttributes = @{ NSUnderlineStyleAttributeName : @1 };
|
||||
|
||||
NSMutableAttributedString* res = [[NSMutableAttributedString alloc] init];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user