From f72331860180d03914af080cfaccda8cdd786b27 Mon Sep 17 00:00:00 2001 From: Randall Luecke Date: Tue, 22 Feb 2011 22:07:31 -0500 Subject: [PATCH] Column resize fixes --- AppKit/CPTableView.j | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/AppKit/CPTableView.j b/AppKit/CPTableView.j index 1ddaa23a5..71a3e2b1d 100644 --- a/AppKit/CPTableView.j +++ b/AppKit/CPTableView.j @@ -1901,7 +1901,7 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5; /*! @ignore - FIX ME: this is broken + FIX ME: this can be a lot faster */ - (void)_resizeAllColumnUniformlyWithOldSize:(CGSize)oldSize { @@ -1961,7 +1961,12 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5; // now that we've reached the end we know there are likely rounding errors // so we should size the last resized to fit - var delta = superviewWidth - _CGRectGetMaxX([self rectOfColumn:[self numberOfColumns] - 1]), + + // find the last visisble column + while (count-- && [_tableColumns[count] isHidden]) ; + + // find the max x, but subtract a single pixel since the spacing isn't applicable here. + var delta = superviewWidth - _CGRectGetMaxX([self rectOfColumn:count]) - ([self intercellSpacing].width || 1), newSize = [item width] + delta; [item _tryToResizeToWidth:newSize];