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

still show the progress bar in compact view for selected rows

This commit is contained in:
Mitchell Livingston 2010-03-28 01:29:40 +00:00
parent 2c67d88bde
commit 115e763ac7
2 changed files with 22 additions and 23 deletions

View file

@ -28,7 +28,7 @@
+ (NSGradient *) progressGradientForRed: (CGFloat) redComponent green: (CGFloat) greenComponent blue: (CGFloat) blueComponent + (NSGradient *) progressGradientForRed: (CGFloat) redComponent green: (CGFloat) greenComponent blue: (CGFloat) blueComponent
{ {
const CGFloat alpha = [[NSUserDefaults standardUserDefaults] boolForKey: @"SmallView"] ? 0.265 : 1.0; const CGFloat alpha = [[NSUserDefaults standardUserDefaults] boolForKey: @"SmallView"] ? 0.28 : 1.0;
NSColor * baseColor = [NSColor colorWithCalibratedRed: redComponent green: greenComponent blue: blueComponent alpha: alpha]; NSColor * baseColor = [NSColor colorWithCalibratedRed: redComponent green: greenComponent blue: blueComponent alpha: alpha];

View file

@ -71,7 +71,8 @@
- (NSRect) rectForTitleWithString: (NSAttributedString *) string withRightBound: (CGFloat) rightBound inBounds: (NSRect) bounds; - (NSRect) rectForTitleWithString: (NSAttributedString *) string withRightBound: (CGFloat) rightBound inBounds: (NSRect) bounds;
- (NSRect) rectForProgressWithStringInBounds: (NSRect) bounds; - (NSRect) rectForProgressWithStringInBounds: (NSRect) bounds;
- (NSRect) rectForStatusWithStringInBounds: (NSRect) bounds; - (NSRect) rectForStatusWithStringInBounds: (NSRect) bounds;
- (NSRect) barRectForBounds: (NSRect) bounds; - (NSRect) barRectRegForBounds: (NSRect) bounds;
- (NSRect) barRectMinForBounds: (NSRect) bounds;
- (NSRect) controlButtonRectForBounds: (NSRect) bounds; - (NSRect) controlButtonRectForBounds: (NSRect) bounds;
- (NSRect) revealButtonRectForBounds: (NSRect) bounds; - (NSRect) revealButtonRectForBounds: (NSRect) bounds;
@ -330,8 +331,7 @@
const BOOL minimal = [fDefaults boolForKey: @"SmallView"]; const BOOL minimal = [fDefaults boolForKey: @"SmallView"];
//bar //bar
if (!minimal || ![self isHighlighted]) [self drawBar: minimal ? [self barRectMinForBounds: cellFrame] : [self barRectRegForBounds: cellFrame]];
[self drawBar: [self barRectForBounds: cellFrame]];
//group coloring //group coloring
const NSRect iconRect = [self iconRectForBounds: cellFrame]; const NSRect iconRect = [self iconRectForBounds: cellFrame];
@ -723,28 +723,27 @@
return result; return result;
} }
- (NSRect) barRectForBounds: (NSRect) bounds - (NSRect) barRectRegForBounds: (NSRect) bounds
{ {
NSRect result; NSRect result;
result.size.height = BAR_HEIGHT;
result.origin.x = NSMinX(bounds) + IMAGE_SIZE_REG + PADDING_BETWEEN_IMAGE_AND_BAR;
result.origin.y = NSMinY(bounds) + PADDING_ABOVE_TITLE + HEIGHT_TITLE + PADDING_BETWEEN_TITLE_AND_PROGRESS
+ HEIGHT_STATUS + PADDING_BETWEEN_PROGRESS_AND_BAR;
if ([fDefaults boolForKey: @"SmallView"]) result.size.width = floor(NSMaxX(bounds) - NSMinX(result) - PADDING_HORIZONTAL
{ - 2.0 * (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH));
result.origin.x = NSMinX(bounds) + IMAGE_SIZE_MIN + PADDING_BETWEEN_IMAGE_AND_BAR;
result.origin.y = NSMinY(bounds) + PADDING_BETWEEN_BAR_AND_EDGE_MIN; return result;
result.size.height = NSHeight(bounds) - 2.0 * PADDING_BETWEEN_BAR_AND_EDGE_MIN; }
result.size.width = NSMaxX(bounds) - NSMinX(result) - PADDING_HORIZONTAL;
} - (NSRect) barRectMinForBounds: (NSRect) bounds
else {
{ NSRect result;
result.size.height = BAR_HEIGHT; result.origin.x = NSMinX(bounds) + IMAGE_SIZE_MIN + PADDING_BETWEEN_IMAGE_AND_BAR;
result.origin.y = NSMinY(bounds) + PADDING_BETWEEN_BAR_AND_EDGE_MIN;
result.origin.x = NSMinX(bounds) + IMAGE_SIZE_REG + PADDING_BETWEEN_IMAGE_AND_BAR; result.size.height = NSHeight(bounds) - 2.0 * PADDING_BETWEEN_BAR_AND_EDGE_MIN;
result.origin.y = NSMinY(bounds) + PADDING_ABOVE_TITLE + HEIGHT_TITLE + PADDING_BETWEEN_TITLE_AND_PROGRESS result.size.width = NSMaxX(bounds) - NSMinX(result) - PADDING_HORIZONTAL;
+ HEIGHT_STATUS + PADDING_BETWEEN_PROGRESS_AND_BAR;
result.size.width = floor(NSMaxX(bounds) - NSMinX(result) - PADDING_HORIZONTAL
- 2.0 * (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH));
}
return result; return result;
} }