Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Gradient selection for list items

Gradient selection for list items
Thread Tools
Forum Regular
Join Date: Sep 2000
Location: Chico, California
Status: Offline
Reply With Quote
Nov 13, 2003, 06:11 PM
 
Is it possible to enable the gradient selection scheme through Interface Builder? I mean the nice blue gradient you see in the Finder sidebar, iCal calendar list, and iTunes playlists. Is it a new thing with Panther or something?
     
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status: Offline
Reply With Quote
Nov 13, 2003, 07:23 PM
 
It's not a standard feature that third party developers can just turn on. It's part of a custom control implemented by Apple's apps (and implemented differently by each, no less).

If you want to use it in your own app, you'll have to write your own code to draw it. If your list is a Cocoa NSTableView, it looks like the best way to do that might be by subclassing and overriding -highlightSelectionInClipRect:.

However, I'd recommend against using the gradient selection indicator until Apple puts out HI guidelines for when to use it. (Or at least, make sure you're using it in exactly the same context Apple uses it in.) And realize that by using the blue gradient, you're effectively overriding the user's choice of highlight color from System Preferences.
Rick Roe
icons.cx | weblog
     
Forum Regular
Join Date: Sep 2000
Location: Chico, California
Status: Offline
Reply With Quote
Nov 13, 2003, 07:46 PM
 
Thank you for the detailed reply! Basically, I was playing around with Mail's .nib files and I was just wondering if there was a way to enable the gradient selection for mailboxes in the Drawer. Currently, selected Mailboxes are Grey... so they are not even adhering to any standard set by System Preferences. The gradient selection would seem very appropriate for this case IMO.

I know I shouldn't be tinkering with the Mail interface, there were just a couple things I thought needed tweaking. This, and alternating background colors for the message listings, which I successfully enabled with little effort. (Why Apple doesn't have alternating background colors enabled by default is beyond me.)


-------------


Actually, now that I think about it, maybe gradient selection wouldn't be the best for this situation. Suppose you select more than one mailbox in the drawer by holding shift, then the selection would have to span multiple mailboxes and the gradient would have to resize. All the other apps that use this gradient selection don't allow you to select multiple items.

Regardless, it would be nice if Mail would pay attention to the color set by System Preferences to show for selecting mailboxes.
     
Mac Elite
Join Date: Oct 2001
Status: Offline
Reply With Quote
Nov 14, 2003, 06:48 AM
 
Originally posted by Rickster:
However, I'd recommend against using the gradient selection indicator until Apple puts out HI guidelines for when to use it. (Or at least, make sure you're using it in exactly the same context Apple uses it in.) And realize that by using the blue gradient, you're effectively overriding the user's choice of highlight color from System Preferences.
Although Apple has not stated any guidelines for using the blue gradient in the HIG, they seem to be setting a precedent for its use. I suppose it's kind of like how they set a precedent for Brushed Metal in its early days without really telling us what it was for or when to use it. Source Lists in the Finder and iTunes use the gradient to distinguish source lists somewhat from a content list. I bet there's a good chance a future iPhoto update might use the blue gradient for its source lists.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:25 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2