Re: How can I get horizontal scrollbars adequate to the widest list entry
Re: How can I get horizontal scrollbars adequate to the widest list entry
- Subject: Re: How can I get horizontal scrollbars adequate to the widest list entry
- From: Steven Mills via Cocoa-dev <email@hidden>
- Date: Wed, 11 Nov 2020 09:19:23 -0600
On Nov 11, 2020, at 08:54:02, Andreas Falkenhahn via Cocoa-dev
<email@hidden> wrote:
>
> However, this still isn't perfect because the last two characters of the
> widest entry are still cut off and replaced by "...". Of course, I can solve
> this by just adding something a few points to size.width but of course I
> don't want that because I'm looking for a solution that works with all UI
> fonts and sizes so hard-coding a certain point value that is added to
> size.width is definitely a no-go...
Yes, just add a fudge factor to ensure the column will be wide enough to
accommodate the string width AND the spacing between the left and right edges
of the actual NSTextField in the cell. You can inspect the field in the table
to see those distances.
You might even be able to mess with the constraints on the text field to force
field to never shrink smaller than the text by adding constraints to the field
and setting the Content Compression Resistance Priority, Horizontal to 1000 or
something at least higher than 750. Try turning on the field's Single Line Mode
as well.
--
Steve Mills
Drummer, Mac geek
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden