small code nudges here and there

This commit is contained in:
Mitchell Livingston 2009-12-23 02:02:11 +00:00
parent c9a3324684
commit 5812c61812
5 changed files with 17 additions and 18 deletions

View File

@ -47,14 +47,14 @@ AboutWindowController * fAboutBoxInstance = nil;
[[NSBundle mainBundle] pathForResource: @"Credits" ofType: @"rtf"] documentAttributes: nil] autorelease]]; [[NSBundle mainBundle] pathForResource: @"Credits" ofType: @"rtf"] documentAttributes: nil] autorelease]];
//size license button //size license button
CGFloat oldButtonWidth = [fLicenseButton frame].size.width; const CGFloat oldButtonWidth = [fLicenseButton frame].size.width;
[fLicenseButton setTitle: NSLocalizedString(@"License", "About window -> license button")]; [fLicenseButton setTitle: NSLocalizedString(@"License", "About window -> license button")];
[fLicenseButton sizeToFit]; [fLicenseButton sizeToFit];
NSRect buttonFrame = [fLicenseButton frame]; NSRect buttonFrame = [fLicenseButton frame];
buttonFrame.size.width += 10.0f; buttonFrame.size.width += 10.0;
buttonFrame.origin.x -= buttonFrame.size.width - oldButtonWidth; buttonFrame.origin.x -= NSWidth(buttonFrame) - oldButtonWidth;
[fLicenseButton setFrame: buttonFrame]; [fLicenseButton setFrame: buttonFrame];
} }

View File

@ -47,11 +47,11 @@
{ {
[fButton setTitle: NSLocalizedString(@"Cancel", "Blocklist -> cancel button")]; [fButton setTitle: NSLocalizedString(@"Cancel", "Blocklist -> cancel button")];
const CGFloat oldWidth = [fButton frame].size.width; const CGFloat oldWidth = NSWidth([fButton frame]);
[fButton sizeToFit]; [fButton sizeToFit];
NSRect buttonFrame = [fButton frame]; NSRect buttonFrame = [fButton frame];
buttonFrame.size.width += 12.0f; //sizeToFit sizes a bit too small buttonFrame.size.width += 12.0; //sizeToFit sizes a bit too small
buttonFrame.origin.x -= buttonFrame.size.width - oldWidth; buttonFrame.origin.x -= NSWidth(buttonFrame) - oldWidth;
[fButton setFrame: buttonFrame]; [fButton setFrame: buttonFrame];
[fProgressBar setUsesThreadedAnimation: YES]; [fProgressBar setUsesThreadedAnimation: YES];

View File

@ -4090,8 +4090,11 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
[scrollView setHasVerticalScroller: YES]; [scrollView setHasVerticalScroller: YES];
//hack to ensure scrollbars don't disappear after resizing //hack to ensure scrollbars don't disappear after resizing
[scrollView setAutohidesScrollers: NO]; if (![NSApp isOnSnowLeopardOrBetter])
[scrollView setAutohidesScrollers: YES]; {
[scrollView setAutohidesScrollers: NO];
[scrollView setAutohidesScrollers: YES];
}
} }
} }

View File

@ -145,7 +145,6 @@
- (void) setURL: (NSString *) url - (void) setURL: (NSString *) url
{ {
#warning get magnet image/phrase
[[self contentView] setOverlay: [NSImage imageNamed: @"Globe.png"] [[self contentView] setOverlay: [NSImage imageNamed: @"Globe.png"]
mainLine: NSLocalizedString(@"Web Address", "Drag overlay -> url") subLine: url]; mainLine: NSLocalizedString(@"Web Address", "Drag overlay -> url") subLine: url];
[self fadeIn]; [self fadeIn];

View File

@ -240,7 +240,7 @@
if (![[self itemAtRow: row] isKindOfClass: [Torrent class]]) if (![[self itemAtRow: row] isKindOfClass: [Torrent class]])
continue; continue;
NSDictionary * userInfo = [NSDictionary dictionaryWithObject: [NSNumber numberWithUnsignedInteger: row] forKey: @"Row"]; NSDictionary * userInfo = [NSDictionary dictionaryWithObject: [NSNumber numberWithInteger: row] forKey: @"Row"];
TorrentCell * cell = (TorrentCell *)[self preparedCellAtColumn: -1 row: row]; TorrentCell * cell = (TorrentCell *)[self preparedCellAtColumn: -1 row: row];
[cell addTrackingAreasForView: self inRect: [self rectOfRow: row] withUserInfo: userInfo mouseLocation: mouseLocation]; [cell addTrackingAreasForView: self inRect: [self rectOfRow: row] withUserInfo: userInfo mouseLocation: mouseLocation];
} }
@ -287,7 +287,7 @@
NSNumber * row; NSNumber * row;
if ((row = [dict objectForKey: @"Row"])) if ((row = [dict objectForKey: @"Row"]))
{ {
NSInteger rowVal = [row intValue]; NSInteger rowVal = [row integerValue];
NSString * type = [dict objectForKey: @"Type"]; NSString * type = [dict objectForKey: @"Type"];
if ([type isEqualToString: @"Action"]) if ([type isEqualToString: @"Action"])
fMouseActionRow = rowVal; fMouseActionRow = rowVal;
@ -315,7 +315,7 @@
else else
fMouseRevealRow = -1; fMouseRevealRow = -1;
[self setNeedsDisplayInRect: [self rectOfRow: [row intValue]]]; [self setNeedsDisplayInRect: [self rectOfRow: [row integerValue]]];
} }
} }
@ -411,20 +411,17 @@
{ {
if ([item isKindOfClass: [Torrent class]]) if ([item isKindOfClass: [Torrent class]])
{ {
NSInteger index = [self rowForItem: item]; const NSInteger index = [self rowForItem: item];
if (index != -1) if (index != -1)
[indexSet addIndex: index]; [indexSet addIndex: index];
} }
else else
{ {
NSInteger group = [item groupIndex]; const NSInteger group = [item groupIndex];
for (NSInteger i = 0; i < [self numberOfRows]; i++) for (NSInteger i = 0; i < [self numberOfRows]; i++)
{ {
if ([indexSet containsIndex: i])
continue;
id tableItem = [self itemAtRow: i]; id tableItem = [self itemAtRow: i];
if (![tableItem isKindOfClass: [Torrent class]] && group == [tableItem groupIndex]) if ([tableItem isKindOfClass: [TorrentGroup class]] && group == [tableItem groupIndex])
{ {
[indexSet addIndex: i]; [indexSet addIndex: i];
break; break;