mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Do not use OakFileIconImage for menu items and recent projects
On macOS 10.14 this image doesn’t always render, so this is a temporary workaround. The main advantage of using OakFileIconImage is the added SCM badge and custom icon for known file types.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#import "Favorites.h"
|
||||
#import <OakFilterList/OakAbbreviations.h>
|
||||
#import <OakAppKit/OakAppKit.h>
|
||||
#import <OakAppKit/OakFileIconImage.h>
|
||||
#import <OakAppKit/OakUIConstructionFunctions.h>
|
||||
#import <OakAppKit/OakScopeBarView.h>
|
||||
#import <OakAppKit/OakSound.h>
|
||||
@@ -200,9 +199,13 @@ static NSUInteger const kOakSourceIndexFavorites = 1;
|
||||
for(NSDictionary* item in items)
|
||||
{
|
||||
NSString* path = item[@"path"];
|
||||
|
||||
NSImage* image = [NSWorkspace.sharedWorkspace iconForFile:path];
|
||||
image.size = NSMakeSize(32, 32);
|
||||
|
||||
NSMutableDictionary* tmp = [item mutableCopy];
|
||||
[tmp addEntriesFromDictionary:@{
|
||||
@"icon": [OakFileIconImage fileIconImageWithPath:path size:NSMakeSize(32, 32)],
|
||||
@"icon": image,
|
||||
@"name": item[@"name"] ?: [NSString stringWithCxxString:path::display_name(to_s(path))],
|
||||
@"folder": item[@"folder"] ?: [[path stringByDeletingLastPathComponent] stringByAbbreviatingWithTildeInPath],
|
||||
@"info": [path stringByAbbreviatingWithTildeInPath]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#import "NSMenu Additions.h"
|
||||
#import "OakFileIconImage.h"
|
||||
#import <OakFoundation/OakFoundation.h>
|
||||
#import <OakFoundation/NSString Additions.h>
|
||||
#import <text/case.h>
|
||||
@@ -117,7 +116,7 @@ static char const* kOakMenuItemTabTrigger = "OakMenuItemTabTrigger";
|
||||
{
|
||||
NSImage* icon = nil;
|
||||
if([[NSFileManager defaultManager] fileExistsAtPath:path])
|
||||
icon = [OakFileIconImage fileIconImageWithPath:path size:NSMakeSize(16, 16)];
|
||||
icon = [[NSWorkspace sharedWorkspace] iconForFile:path];
|
||||
else if(OakNotEmptyString([path pathExtension]))
|
||||
icon = [[NSWorkspace sharedWorkspace] iconForFileType:[path pathExtension]];
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user