1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 00:04:06 +00:00

miscellaneous adjustments

This commit is contained in:
Mitchell Livingston 2007-12-04 16:47:00 +00:00
parent 06743cb430
commit 963d736dce
5 changed files with 11 additions and 24 deletions

View file

@ -132,8 +132,9 @@
//string is in center of image
rect.origin.x += (rect.size.width - stringSize.width) * 0.5;
rect.origin.y += (rect.size.height - stringSize.height) * 0.5;
rect.size = stringSize;
[string drawAtPoint: rect.origin withAttributes: fAttributes];
[string drawInRect: rect withAttributes: fAttributes];
}
@end

View file

@ -261,8 +261,9 @@
//string is in center of image
rect.origin.x += (rect.size.width - stringSize.width) * 0.5;
rect.origin.y += (rect.size.height - stringSize.height) * 0.5;
rect.size = stringSize;
[string drawAtPoint: rect.origin withAttributes: fAttributes];
[string drawInRect: rect withAttributes: fAttributes];
}
@end

View file

@ -91,9 +91,9 @@
fBadge = [fBackBadge copy];
NSSize badgeSize = [fBadge size];
//place icon
[fBadge lockFocus];
const float WIDTH = 64.0;
//place icon
[icon drawInRect: NSMakeRect(PADDING, (badgeSize.height - ICON_WIDTH) * 0.5, ICON_WIDTH, ICON_WIDTH) fromRect: NSZeroRect
operation: NSCompositeSourceOver fraction: 1.0];

View file

@ -27,7 +27,6 @@
@interface FilePriorityCell : NSSegmentedCell
{
NSImage * fLowImage, * fHighImage, * fNormalImage, * fMixedImage, * fNoneImage;
}
@end

View file

@ -92,35 +92,21 @@
{
NSImage * image;
if (count == 0)
{
if (!fNoneImage)
fNoneImage = [NSImage imageNamed: @"PriorityNone.png"];
image = fNoneImage;
}
image = [NSImage imageNamed: @"PriorityNone.png"];
else if (count > 1)
{
if (!fMixedImage)
fMixedImage = [NSImage imageNamed: @"PriorityMixed.png"];
image = fMixedImage;
}
image = [NSImage imageNamed: @"PriorityMixed.png"];
else
{
switch ([[priorities anyObject] intValue])
{
case TR_PRI_NORMAL:
if (!fNormalImage)
fNormalImage = [NSImage imageNamed: @"PriorityNormal.png"];
image = fNormalImage;
image = [NSImage imageNamed: @"PriorityNormal.png"];
break;
case TR_PRI_LOW:
if (!fLowImage)
fLowImage = [NSImage imageNamed: @"PriorityLow.png"];
image = fLowImage;
image = [NSImage imageNamed: @"PriorityLow.png"];
break;
case TR_PRI_HIGH:
if (!fHighImage)
fHighImage = [NSImage imageNamed: @"PriorityHigh.png"];
image = fHighImage;
image = [NSImage imageNamed: @"PriorityHigh.png"];
break;
}
}