From 963d736dce05bfc9c0550b5ad08bdec11188dd26 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Tue, 4 Dec 2007 16:47:00 +0000 Subject: [PATCH] miscellaneous adjustments --- macosx/BadgeView.m | 3 ++- macosx/Badger.m | 3 ++- macosx/DragOverlayView.m | 4 ++-- macosx/FilePriorityCell.h | 1 - macosx/FilePriorityCell.m | 24 +++++------------------- 5 files changed, 11 insertions(+), 24 deletions(-) diff --git a/macosx/BadgeView.m b/macosx/BadgeView.m index 4c3b7bdd8..d55be8965 100644 --- a/macosx/BadgeView.m +++ b/macosx/BadgeView.m @@ -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 diff --git a/macosx/Badger.m b/macosx/Badger.m index f2850e945..572caa325 100644 --- a/macosx/Badger.m +++ b/macosx/Badger.m @@ -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 diff --git a/macosx/DragOverlayView.m b/macosx/DragOverlayView.m index 972f3dead..46fad6c17 100644 --- a/macosx/DragOverlayView.m +++ b/macosx/DragOverlayView.m @@ -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]; diff --git a/macosx/FilePriorityCell.h b/macosx/FilePriorityCell.h index 313fec353..d21b313fd 100644 --- a/macosx/FilePriorityCell.h +++ b/macosx/FilePriorityCell.h @@ -27,7 +27,6 @@ @interface FilePriorityCell : NSSegmentedCell { - NSImage * fLowImage, * fHighImage, * fNormalImage, * fMixedImage, * fNoneImage; } @end diff --git a/macosx/FilePriorityCell.m b/macosx/FilePriorityCell.m index b09358626..e289a4e84 100644 --- a/macosx/FilePriorityCell.m +++ b/macosx/FilePriorityCell.m @@ -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; } }