INAppStoreWindow icon indicating copy to clipboard operation
INAppStoreWindow copied to clipboard

Title bar colour on retina display border issue

Open kieransenior opened this issue 11 years ago • 14 comments

Hey there,

I've noticed that on a retina display the border has a lighter coloured line on top regardless of what you set the title bar colour to be. Perhaps I'm doing something wrong? Any hints? screen shot 2013-06-06 at 15 51 05

kieransenior avatar Jun 06 '13 23:06 kieransenior

Seems like the drawing rectangle passed into the drawing block might be 1px too small. Could you try increasing the height of your drawing rectangle by 1 pixel and see if it works?

indragiek avatar Jun 07 '13 01:06 indragiek

Do you mean just setting titleBarHeight with an extra pixel? If so, I've tried that to no avail.

kieransenior avatar Jun 07 '13 05:06 kieransenior

@indragiek This is the line of code which is the culprit. Get rid of that and it's fixed.

https://github.com/indragiek/INAppStoreWindow/blob/master/INAppStoreWindow.m#L236

kieransenior avatar Jun 07 '13 18:06 kieransenior

That line of code only executes when you're using the default title bar appearance (OS X style) to show the highlight line at the top. If you're using a custom title bar, you should be calling -setTitleBarDrawingBlock: and drawing your custom title bar background in there, and this problem won't appear because the rect will be sized appropriately.

indragiek avatar Jun 08 '13 19:06 indragiek

I haven't passed a block to specify a custom title bar yet, nothing is specified in that respect. Here's what's around so far:

INAppStoreWindow *aWindow = (INAppStoreWindow*)[self window];
aWindow.titleBarHeight = 40.0;
aWindow.titleBarStartColor = [NSColor colorWithCalibratedRed:0.1 green:0.3 blue:0.5 alpha:1];
aWindow.titleBarEndColor = [NSColor colorWithCalibratedRed:0.2 green:0.4 blue:0.6 alpha:1];
aWindow.titleTextColor = [NSColor colorWithCalibratedWhite:1.0 alpha:1.0];
aWindow.trafficLightButtonsLeftMargin = (float)12.0;
aWindow.centerTrafficLightButtons = YES;
aWindow.centerFullScreenButton = YES;
aWindow.fullScreenButtonRightMargin = (float)12.0;

So omitting the block causes the problem?

kieransenior avatar Jun 14 '13 16:06 kieransenior

Oops, I forgot about the title bar color properties. I'll think of a good solution. — Indragie Karunaratne

On Fri, Jun 14, 2013 at 9:27 AM, Kieran Senior [email protected] wrote:

I haven't passed a block to specify a custom title bar yet, nothing is specified in that respect. Here's what's around so far: INAppStoreWindow aWindow = (INAppStoreWindow)[self window]; aWindow.titleBarHeight = 40.0; aWindow.titleBarStartColor = [NSColor colorWithCalibratedRed:0.1 green:0.3 blue:0.5 alpha:1]; aWindow.titleBarEndColor = [NSColor colorWithCalibratedRed:0.2 green:0.4 blue:0.6 alpha:1]; aWindow.titleTextColor = [NSColor colorWithCalibratedWhite:1.0 alpha:1.0]; aWindow.trafficLightButtonsLeftMargin = (float)12.0; aWindow.centerTrafficLightButtons = YES; aWindow.centerFullScreenButton = YES; aWindow.fullScreenButtonRightMargin = (float)12.0;

So omitting the block causes the problem?

Reply to this email directly or view it on GitHub: https://github.com/indragiek/INAppStoreWindow/issues/111#issuecomment-19467328

indragiek avatar Jun 14 '13 19:06 indragiek

Was a fix ever merged in for this issue?

zakdances avatar Sep 16 '13 12:09 zakdances

Not yet. Sorry, totally forgot about this. I'll see if I can put together a fix sometime this week. If you have a solution before then, please feel free to submit a pull request.

indragiek avatar Sep 16 '13 23:09 indragiek

I haven't had a change to look at this in-depth yet. Were you able to explore a possible fix?

zakdances avatar Oct 03 '13 17:10 zakdances

Sorry not yet, this one fell off my radar until I get time to reinvestigate it.

On 3 Oct 2013, at 18:41, zakdances [email protected] wrote:

I haven't had a change to look at this in-depth yet. Were you able to explore a possible fix?

— Reply to this email directly or view it on GitHub.

kieransenior avatar Oct 03 '13 18:10 kieransenior

I've done a little investigating and this is what I'm guessing: INAppStoreWindow's titleBar simply overlaps the default titleBar. Because the default titleBar is kept on, it insets the contentView of the window by 1 pixel (you can NSLog the frame of the contentView to confirm). So what you're seeing here is the default titleBar peaking above the inset INAppStoreWindow titleBar. Does this correspond with what you're seeing as well?

zakdances avatar Oct 06 '13 06:10 zakdances

Yeah that's right - it was just one pixel off from the top. As I say, I'd love to devote some more time to this but I'm swamped at the moment and the project using InAppStoreWindow has been lowered in priority for the moment. I'll re-address it in the near future hopefully. If you manage to find a fix before I do I'll check it out. Issue a pull request and I can check that out and see if it works as I expect, unless I get around to it first :)

kieransenior avatar Oct 07 '13 11:10 kieransenior

+1 :-(

vojto avatar Apr 23 '14 12:04 vojto

Still an issue? Rendering code geometry has changed quite a bit recently.

jakepetroules avatar May 17 '14 23:05 jakepetroules