1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 08:43:27 +00:00

Might as well get this small change in.

This commit is contained in:
Mitchell Livingston 2006-06-22 02:51:59 +00:00
parent 500e037c49
commit a067ed6dda
2 changed files with 9 additions and 11 deletions

View file

@ -27,7 +27,8 @@
@interface InfoWindowController : NSWindowController @interface InfoWindowController : NSWindowController
{ {
NSMutableArray * fTorrents, * fFiles; NSArray * fTorrents;
NSMutableArray * fFiles;
NSImage * fAppIcon; NSImage * fAppIcon;
IBOutlet NSTabView * fTabView; IBOutlet NSTabView * fTabView;

View file

@ -55,6 +55,7 @@
{ {
fAppIcon = [[NSApp applicationIconImage] copy]; fAppIcon = [[NSApp applicationIconImage] copy];
fTorrents = [[NSArray alloc] init];
fFiles = [[NSMutableArray alloc] initWithCapacity: 6]; fFiles = [[NSMutableArray alloc] initWithCapacity: 6];
[fFileTable setDoubleAction: @selector(revealFile:)]; [fFileTable setDoubleAction: @selector(revealFile:)];
@ -73,8 +74,7 @@
- (void) dealloc - (void) dealloc
{ {
if (fTorrents) [fTorrents release];
[fTorrents release];
[fFiles release]; [fFiles release];
[fAppIcon release]; [fAppIcon release];
@ -83,8 +83,7 @@
- (void) updateInfoForTorrents: (NSArray *) torrents - (void) updateInfoForTorrents: (NSArray *) torrents
{ {
if (fTorrents) [fTorrents release];
[fTorrents release];
fTorrents = [torrents retain]; fTorrents = [torrents retain];
int numberSelected = [fTorrents count]; int numberSelected = [fTorrents count];
@ -314,8 +313,7 @@
- (NSRect) windowWillUseStandardFrame: (NSWindow *) window defaultFrame: (NSRect) defaultFrame - (NSRect) windowWillUseStandardFrame: (NSWindow *) window defaultFrame: (NSRect) defaultFrame
{ {
NSRect windowRect = [window frame]; NSRect windowRect = [window frame];
windowRect.size.width = [window minSize].width; windowRect.size.width = [window minSize].width;
return windowRect; return windowRect;
} }
@ -328,11 +326,7 @@
- (void) setWindowForTab: (NSString *) identifier animate: (BOOL) animate - (void) setWindowForTab: (NSString *) identifier animate: (BOOL) animate
{ {
NSWindow * window = [self window];
NSRect frame = [window frame];
float height; float height;
if ([identifier isEqualToString: TAB_ACTIVITY_IDENT]) if ([identifier isEqualToString: TAB_ACTIVITY_IDENT])
height = TAB_ACTIVITY_HEIGHT; height = TAB_ACTIVITY_HEIGHT;
else if ([identifier isEqualToString: TAB_OPTIONS_IDENT]) else if ([identifier isEqualToString: TAB_OPTIONS_IDENT])
@ -342,7 +336,10 @@
else else
height = TAB_INFO_HEIGHT; height = TAB_INFO_HEIGHT;
NSWindow * window = [self window];
NSRect frame = [window frame];
NSView * view = [[fTabView selectedTabViewItem] view]; NSView * view = [[fTabView selectedTabViewItem] view];
float difference = height - [view frame].size.height; float difference = height - [view frame].size.height;
frame.origin.y -= difference; frame.origin.y -= difference;
frame.size.height += difference; frame.size.height += difference;