diff --git a/macosx/TorrentCell.m b/macosx/TorrentCell.m index 8aa5b707d..8c06c15b0 100644 --- a/macosx/TorrentCell.m +++ b/macosx/TorrentCell.m @@ -54,7 +54,7 @@ - (void) drawSimpleBar: (NSRect) barRect; - (void) drawAdvancedBar: (NSRect) barRect; -- (NSImage *) advancedBarSimple; +- (NSImage *) advancedBar; - (NSRect) rectForMinimalStatusWithString: (NSAttributedString *) string inBounds: (NSRect) bounds; - (NSRect) rectForTitleWithString: (NSAttributedString *) string basedOnMinimalStatusRect: (NSRect) statusRect @@ -369,7 +369,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 - (void) drawAdvancedBar: (NSRect) barRect { - [[self advancedBarSimple] drawInRect: barRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0]; + [[self advancedBar] drawInRect: barRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0]; if (!fTransparentGradient) fTransparentGradient = [[CTGradient progressTransparentGradient] retain]; @@ -379,7 +379,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 [NSBezierPath strokeRect: NSInsetRect(barRect, 0.5, 0.5)]; } -- (NSImage *) advancedBarSimple +- (NSImage *) advancedBar { if (!fBitmap) fBitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes: nil diff --git a/macosx/TorrentTableView.h b/macosx/TorrentTableView.h index 4000bf663..d1a7cbf63 100644 --- a/macosx/TorrentTableView.h +++ b/macosx/TorrentTableView.h @@ -26,8 +26,6 @@ #import #import -#define PADDING 3.0 - //button layout (from end of bar) is: button, padding, button, padding #define BUTTON_WIDTH 14.0 #define BUTTONS_TOTAL_WIDTH 36.0 diff --git a/macosx/TorrentTableView.m b/macosx/TorrentTableView.m index 416309f7f..7941911dd 100644 --- a/macosx/TorrentTableView.m +++ b/macosx/TorrentTableView.m @@ -27,6 +27,8 @@ #import "Controller.h" #import "Torrent.h" +#define PADDING 3.0 + #define BUTTON_TO_TOP_REGULAR 33.0 #define BUTTON_TO_TOP_SMALL 20.0 @@ -474,17 +476,15 @@ { if (row < 0) return NSZeroRect; - else if ([fDefaults boolForKey: @"SmallView"]) - { - TorrentCell * cell = [[self tableColumnWithIdentifier: @"Torrent"] dataCell]; - return [cell iconRectForBounds: [self frameOfCellAtColumn: 0 row: row]]; - } - else; - NSRect cellRect = [self frameOfCellAtColumn: [self columnWithIdentifier: @"Torrent"] row: row]; + TorrentCell * cell = [[self tableColumnWithIdentifier: @"Torrent"] dataCell]; + NSRect cellRect = [self frameOfCellAtColumn: 0 row: row], + iconRect = [cell iconRectForBounds: cellRect]; - return NSMakeRect(cellRect.origin.x + PADDING + - ([[[fTorrents objectAtIndex: row] iconFlipped] size].width - ACTION_BUTTON_WIDTH) * 0.5, + if ([fDefaults boolForKey: @"SmallView"]) + return iconRect; + else + return NSMakeRect(iconRect.origin.x + (iconRect.size.width - ACTION_BUTTON_WIDTH) * 0.5, cellRect.origin.y + ACTION_BUTTON_TO_TOP, ACTION_BUTTON_WIDTH, ACTION_BUTTON_HEIGHT); }