# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1602575484 0 # Node ID 3bb5a74b42314895ae567bf01caf695f1c7473ff # Parent fe54e67cec3b056157943539f6415883e8a2f89b Mac: First attempt to get optimize and auto-box-sizing working with NSView based Containers. diff -r fe54e67cec3b -r 3bb5a74b4231 mac/dw.m --- a/mac/dw.m Tue Oct 13 07:24:07 2020 +0000 +++ b/mac/dw.m Tue Oct 13 07:51:24 2020 +0000 @@ -2809,11 +2809,24 @@ { #ifdef BUILDING_FOR_YOSEMITE NSTableCellView *cell = [self viewAtColumn:z row:x makeIfNecessary:YES]; - int thiswidth = NSWidth([cell frame]); + int thiswidth = 4, thisheight = 0; + + if([cell imageView]) + { + thiswidth += [[cell imageView] image].size.width; + thisheight = [[cell imageView] image].size.height; + } + if([cell textField]) + { + int textheight = [[cell textField] intrinsicContentSize].width; + thiswidth += [[cell textField] intrinsicContentSize].width; + if(textheight > thisheight) + thisheight = textheight; + } /* If on the first column... add up the heights */ if(z == 0) - cheight += NSHeight([cell frame]); + cheight += thisheight; #else NSCell *cell = [self preparedCellAtColumn:z row:x]; int thiswidth = [cell cellSize].width; @@ -2876,7 +2889,12 @@ { #ifdef BUILDING_FOR_YOSEMITE NSTableCellView *cell = [self viewAtColumn:z row:x makeIfNecessary:YES]; - int thiswidth = NSWidth([cell frame]); + int thiswidth = 4; + + if([cell imageView]) + thiswidth += [[cell imageView] image].size.width; + if([cell textField]) + thiswidth += [[cell textField] intrinsicContentSize].width; #else NSCell *cell = [self preparedCellAtColumn:z row:x]; int thiswidth = [cell cellSize].width;