I'm manually calculating the minimum size of my NSTableColumn to avoid text 
ellipsization. The calculation looks like this:

   NSCell *cell = [m_view preparedCellAtColumn:m_column row:row];

   int width = ceil([cell cellSize].width);

   if(m_column == [m_view outlineTableColumn]) {
      width += [m_view indentationPerLevel] * [m_view levelForRow:row];
      width += m_expander;
   }

The m_expander value is calculated like this:

   // assume that row 0 has an expander
   NSRect rc = [m_view frameOfOutlineCellAtRow:0];
   m_expander = ceil(rc.origin.x + rc.size.width);

This works nicely on 10.13. See here: https://imgur.com/w8uT4gu 

On macOS 11, however, the calculation is not correct and the text gets 
ellipsized, see here: https://imgur.com/HiOBVjh 

Debugging has shown that m_expander is missing 4 pixels on macOS 11. On macOS 
10.13 rc.origin.x is 6 and rc.size.width is 12. On macOS 11, rc.origin.x is 2 
and rc.size.width is 12. However, this seems to be correct because you can see 
that the space to the left of the expander is smaller on macOS 11 than on macOS 
10.13 so the values look correct. All other values are identical between 10.13 
and 11. The column width computed by 10.13 is 169 and the column width computed 
by macOS 11 is 165.

Still, as you can see, the overall column width calculation is not correct on 
macOS 11 because the text gets ellipsized. Anybody got an idea what the problem 
here is?

-- 
Best regards,
 Andreas Falkenhahn                          mailto:andr...@falkenhahn.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to