Re: Making an iTunes style bar
Re: Making an iTunes style bar
- Subject: Re: Making an iTunes style bar
- From: Conor Dearden <email@hidden>
- Date: Mon, 03 Apr 2006 10:47:10 +0200
Hi Bobby,
The code would be the same could as for the left side. They are both table
views. As you mentioned you overwrite
-(void)highlightSelectionInClipRect:(NSRect)clipRect. This is where you
draw the gradient.
>How would it would as far as not overwriting the text
NSTableView is smart it knows in what order to send the calls of the methods
and how to put them together. So the text will not be overwritten as the
table will draw the text after on top of your gradient.
>getting it the right size
Use the given clipRect to determine the size, assuming your rows are not of
variable height the gradient can be an image prepared to that exact 17 pixel
height before hand in Photoshop. (In this case you might have to go over a
bit if you want to extend the shadow into the row underneath.)
> having it be erased when you move
NSTableView will redraw itself automatically when the selections changes to
it's non-highlighted state.
> getting the gradient
The gradient you create as an image. Full vertical height but thin on the
horizontal, your going to repeat it horizontally, maybe even just one pixel
but it's easier to work with more for visual purposes.
This here is Gamepedia's collection highlight pattern:
collectionHeighlightColor = [[NSColor colorWithPatternImage:[NSImage
imageNamed:@"collectionHighlight.png"]] retain];
With collectionHeighlightColor as the set color you can draw in your
gradient pattern.
The only problem might be the horizontal lines of the column separation can
be seen through the gradient. You might try a semi transparent gradient with
the alpha level set to around 0.7, but then remember to draw the gradient in
darker colors, as I will look lighter translucent. Once you have it working
it's all about trial and error with changing the gradient image. Also
getting the right position for the beginning of the tiling pattern can be
fun due to the inverted y-axis; but that is in the code you mentioned.
Regards,
Conor
http://www.bruji.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden