match floppy icons with mac icons
BIN
Mini vMac/Assets.xcassets/floppy.imageset/floppy.png
vendored
Before Width: | Height: | Size: 265 B After Width: | Height: | Size: 241 B |
Before Width: | Height: | Size: 508 B After Width: | Height: | Size: 411 B |
Before Width: | Height: | Size: 798 B After Width: | Height: | Size: 661 B |
23
Mini vMac/Assets.xcassets/floppyV.imageset/Contents.json
vendored
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "floppyV.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "floppyV@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "floppyV@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
BIN
Mini vMac/Assets.xcassets/floppyV.imageset/floppyV.png
vendored
Normal file
After Width: | Height: | Size: 279 B |
BIN
Mini vMac/Assets.xcassets/floppyV.imageset/floppyV@2x.png
vendored
Normal file
After Width: | Height: | Size: 467 B |
BIN
Mini vMac/Assets.xcassets/floppyV.imageset/floppyV@3x.png
vendored
Normal file
After Width: | Height: | Size: 731 B |
|
@ -523,13 +523,15 @@
|
||||||
_filePath = filePath;
|
_filePath = filePath;
|
||||||
NSString *fileName = filePath.lastPathComponent;
|
NSString *fileName = filePath.lastPathComponent;
|
||||||
self.textLabel.text = self.showExtension ? fileName : fileName.stringByDeletingPathExtension;
|
self.textLabel.text = self.showExtension ? fileName : fileName.stringByDeletingPathExtension;
|
||||||
NSDictionary *attributes = [[NSURL fileURLWithPath:filePath] resourceValuesForKeys:@[NSURLTotalFileSizeKey] error:NULL];
|
NSDictionary *attributes = [[NSURL fileURLWithPath:filePath] resourceValuesForKeys:@[NSURLTotalFileSizeKey, NSURLFileSizeKey] error:NULL];
|
||||||
if (attributes && attributes[NSURLTotalFileSizeKey]) {
|
if (attributes && attributes[NSURLTotalFileSizeKey]) {
|
||||||
BOOL isDiskImage = [[AppDelegate sharedInstance].diskImageExtensions containsObject:fileName.pathExtension.lowercaseString];
|
BOOL isDiskImage = [[AppDelegate sharedInstance].diskImageExtensions containsObject:fileName.pathExtension.lowercaseString];
|
||||||
if (isDiskImage) {
|
if (isDiskImage) {
|
||||||
UIImage *icon = [UIImage imageWithIconForDiskImage:filePath];
|
UIImage *icon = [UIImage imageWithIconForDiskImage:filePath];
|
||||||
if (icon == nil) {
|
if (icon == nil) {
|
||||||
icon = [UIImage imageNamed:@"floppy"];
|
NSInteger fileSize = [attributes[NSURLTotalFileSizeKey] integerValue];
|
||||||
|
NSInteger numBlocks = fileSize / 512;
|
||||||
|
icon = [UIImage imageNamed:numBlocks == 800 || numBlocks == 1600 ? @"floppy" : @"floppyV"];
|
||||||
}
|
}
|
||||||
self.imageView.image = icon;
|
self.imageView.image = icon;
|
||||||
} else {
|
} else {
|
||||||
|
|