New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace images in wxRendererMac::DrawTitleBarBitmap() with drawing code. #104
Conversation
32dc5fb
to
9d8ef08
Compare
@vadz previous comments where lost when I pushed the updated implementation, so I'll reply here: |
dc.SetPen(wxPen(glyphColor, 1 * contentScale)); | ||
|
||
wxRect centerRect(rect); | ||
centerRect.Inflate(-5 * contentScale); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be written a bit more clearly as Deflate(5*contentScale)
.
Sorry for the delay, I've finally reviewed the latest version of the patch. If the latest comments could be addressed (especially the one about |
I've integrated your comments, but I wasn't able to use |
It would be great if somebody with a retina Mac could debug this, it's really appalling that we don't have a way to create a bitmap in a portable way :-( Also, sorry to be a pain, but what about the hardcoded RGB values? They seem to be there without any explanations... |
The low resolution (14x14) bitmaps scaled badly on high resolution displays. A close button suitable for usage inside a window (like wxInfoBar) is not available via HI theme drawing methods. This drawing code tries to emulate a close button, as close as possible to the one found in the Xcode 6+ welcome window.
@vadz As for the RGB values I've included a comment that they are hard coded based on the Xcode 6+ welcome screen. I haven't found a good match using any system colors, which would obviously be a nicer approach. I've also added documentation for |
Bitmap for the close button is scaled based on GetContentScaleFactor(). On OS X the resulting bitmap has to use the correct scaling factor in order to be displayed correctly on the button when using a high resolution display.
The two methods were previously undocumented but might be of interest to user code for high DPI display compatibility.
Great, thanks for fixing this! |
The low resolution (14x14) bitmaps scaled badly on high resolution displays. A close button suitable for usage inside a window (like
wxInfoBar
) is not available via HI theme drawing methods. This drawing code tries to emulate a close button, as close as possible to the one found in the Xcode 6+ welcome window.Normal: Hover: Old implementation: