1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 01:03:01 +00:00

don't use setFlipped: on the file node's image on 10.6

This commit is contained in:
Mitchell Livingston 2009-10-18 03:02:10 +00:00
parent 23230f519e
commit 045b7d92fb
4 changed files with 15 additions and 14 deletions

View file

@ -116,10 +116,7 @@
- (NSImage *) icon
{
if (!fIsFolder && !fIcon)
{
fIcon = [[[NSWorkspace sharedWorkspace] iconForFileType: [fName pathExtension]] retain];
[fIcon setFlipped: YES];
}
return fIcon;
}

View file

@ -26,6 +26,7 @@
#import "FileOutlineView.h"
#import "Torrent.h"
#import "FileListNode.h"
#import "NSApplicationAdditions.h"
#import "NSStringAdditions.h"
#define PADDING_HORIZONAL 2.0f
@ -97,10 +98,7 @@
if ([node isFolder])
{
if (!fFolderImage)
{
fFolderImage = [[[NSWorkspace sharedWorkspace] iconForFileType: NSFileTypeForHFSTypeCode('fldr')] copy];
[fFolderImage setFlipped: YES];
}
image = fFolderImage;
}
else
@ -137,7 +135,15 @@
- (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView
{
//icon
[[self image] drawInRect: [self imageRectForBounds: cellFrame] fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0];
if ([NSApp isOnSnowLeopardOrBetter])
[[self image] drawInRect: [self imageRectForBounds: cellFrame] fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0
respectFlipped: YES hints: nil];
else
{
NSImage * image = [self image];
[image setFlipped: YES];
[image drawInRect: [self imageRectForBounds: cellFrame] fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0];
}
NSColor * titleColor, * statusColor;
if ([self backgroundStyle] == NSBackgroundStyleDark)

View file

@ -297,13 +297,11 @@
- (void) ruleEditorRowsDidChange: (NSNotification *) notification
{
CGFloat rowHeight = [fRuleEditor rowHeight];
NSInteger numberOfRows = [fRuleEditor numberOfRows];
CGFloat ruleEditorHeight = numberOfRows * rowHeight;
CGFloat heightDifference = ruleEditorHeight - [fRuleEditor frame].size.height;
NSRect windowFrame = [fRuleEditor window].frame;
const CGFloat heightDifference = [fRuleEditor numberOfRows] * [fRuleEditor rowHeight] - [fRuleEditor frame].size.height;
NSRect windowFrame = [fRuleEditor window].frame;
windowFrame.size.height += heightDifference;
windowFrame.origin.y -= heightDifference;
windowFrame.origin.y -= heightDifference;
[fRuleEditor.window setFrame: windowFrame display: YES animate: YES];
}

View file

@ -904,7 +904,7 @@
NSImage * icon;
if (![node isFolder])
icon = [[NSWorkspace sharedWorkspace] iconForFileType: [name pathExtension]];
icon = [node icon];
else
{
NSMenu * itemMenu = [[NSMenu alloc] initWithTitle: name];