1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

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]];
//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 sizeToFit];
NSRect buttonFrame = [fLicenseButton frame];
buttonFrame.size.width += 10.0f;
buttonFrame.origin.x -= buttonFrame.size.width - oldButtonWidth;
buttonFrame.size.width += 10.0;
buttonFrame.origin.x -= NSWidth(buttonFrame) - oldButtonWidth;
[fLicenseButton setFrame: buttonFrame];
}

View file

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

View file

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

View file

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

View file

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