From 658741d6bb391230e1e2812bd86d139914dc8d5b Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Mon, 30 Jun 2008 19:52:18 +0000 Subject: [PATCH] #1065 QL Zooming in the inspector wasn't zooming to the icon --- macosx/FileOutlineView.m | 8 ++++++-- macosx/NSStringAdditions.m | 2 -- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/macosx/FileOutlineView.m b/macosx/FileOutlineView.m index 13db0801a..bbc58d87b 100644 --- a/macosx/FileOutlineView.m +++ b/macosx/FileOutlineView.m @@ -116,8 +116,12 @@ - (NSRect) iconRectForRow: (int) row { - FileNameCell * cell = (FileNameCell *)[[self tableColumnWithIdentifier: @"Name"] dataCell]; - return [cell imageRectForBounds: [self rectOfRow: row]]; + FileNameCell * cell = (FileNameCell *)[self preparedCellAtColumn: [self columnWithIdentifier: @"Name"] row: row]; + NSRect iconRect = [cell imageRectForBounds: [self rectOfRow: row]]; + + iconRect.origin.x += [self frameOfOutlineCellAtRow: row].size.width; + iconRect.origin.x += [self indentationPerLevel] * (float)([self levelForRow: row] + ([[self itemAtRow: row] isFolder] ? 0 : 1)); + return iconRect; } - (void) updateTrackingAreas diff --git a/macosx/NSStringAdditions.m b/macosx/NSStringAdditions.m index 6f0c625a0..df22d3ecc 100644 --- a/macosx/NSStringAdditions.m +++ b/macosx/NSStringAdditions.m @@ -150,14 +150,12 @@ int comparisonOptions = [NSApp isOnLeopardOrBetter] ? (NSCaseInsensitiveSearch | NSNumericSearch | NSWidthInsensitiveSearch | NSForcedOrderingSearch) : (NSCaseInsensitiveSearch | NSNumericSearch); - return [self compare: string options: comparisonOptions range: NSMakeRange(0, [self length]) locale: [NSLocale currentLocale]]; } - (NSComparisonResult) compareNumeric: (NSString *) string { int comparisonOptions = [NSApp isOnLeopardOrBetter] ? (NSNumericSearch | NSForcedOrderingSearch) : NSNumericSearch; - return [self compare: string options: comparisonOptions range: NSMakeRange(0, [self length]) locale: [NSLocale currentLocale]]; }