Re: Sidebar outline view, rowSizeStyle, and bold text
Re: Sidebar outline view, rowSizeStyle, and bold text
- Subject: Re: Sidebar outline view, rowSizeStyle, and bold text
- From: corbin dunn <email@hidden>
- Date: Fri, 10 Jun 2016 15:08:30 -0700
> On Jun 10, 2016, at 9:54 AM, David Catmull <email@hidden> wrote:
>
> OK, thanks. I wasn’t thinking of bold being affected by row size, but I guess it makes sense that it's going to reset the font entirely.
Yeah, and if you want to have more control then don’t use the textField outlet (make your own), and appkit won’t do any formatting.
corbin
>
> On Fri, Jun 10, 2016 at 10:46 AM, corbin dunn <email@hidden <mailto:email@hidden>> wrote:
>
>> On Jun 10, 2016, at 7:58 AM, David Catmull <email@hidden <mailto:email@hidden>> wrote:
>>
>> I have a view-based, sidebar-style NSOutlineView. For some items, I want to
>> make the text bold. But if I change the rowSizeStyle to medium instead of
>> the default (in awakeFromNib), the text doesn't display as bold. If instead
>> I use a custom row size (in outlineView:heightOfRowByItem:) it works. What
>> gives?
>
> Let’s take a look at the header :)
>
> typedef NS_ENUM(NSInteger, NSTableViewRowSizeStyle) {
> /* The table will use the system default layout size: small, medium or large. */
> NSTableViewRowSizeStyleDefault = -1,
>
> /* The table will use the -rowHeight or ask the delegate for a variable row height (if implemented) and cell layout is not changed. */
> NSTableViewRowSizeStyleCustom = 0,
>
> /* The table will use a row height specified for a small/medium or large table.
> It is required that all sizes be fully tested and supported if NSTableViewRowSizeStyleCustom is not used.
> Some standard Aqua metrics may be applied to cells based on the current size. */
> NSTableViewRowSizeStyleSmall = 1,
> NSTableViewRowSizeStyleMedium = 2,
> NSTableViewRowSizeStyleLarge = 3,
> } NS_ENUM_AVAILABLE_MAC(10_7);
>
>
> So, if you set it to Small/Medium/Large then you will get some standard metrics applied to things. Specifically, things setup to these outlets on an NSTableCellView:
>
> @property (nullable, assign) IBOutlet NSTextField *textField;
> @property (nullable, assign) IBOutlet NSImageView *imageView;
>
>
>
>
>
> corbin
>
>
>
>
>
>>
>> I'm setting it to bold in outlineView:viewForTableColumn:item: by setting
>> view.textField.font = NSFont boldSystemFontOfSize
>> :view.textField.font.pointSize].
>> _______________________________________________
>>
>> Cocoa-dev mailing list (email@hidden <mailto: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 <http://lists.apple.com/>
>>
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden <mailto:email@hidden>
>
_______________________________________________
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