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
feat(macos): Fix with_titlebar_transparent
, add WindowExtMacOS::set_titlebar_transparent
#372
Conversation
there is also |
Ah, looks like you're right! I made it so |
titlebar_transparent
titlebar_transparent
with_titlebar_transparent
, add WindowExtMacOS::set_titlebar_transparent
let mut style_mask = ns_window.styleMask(); | ||
style_mask.set( | ||
NSWindowStyleMask::NSFullSizeContentViewWindowMask, | ||
true, | ||
); | ||
ns_window.setStyleMask_(style_mask); | ||
|
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.
There is WindowBuilderExtMacOS::with_fullsize_content_view
for exactly doing this. Users should just use it.
let mut style_mask = ns_window.styleMask(); | |
style_mask.set( | |
NSWindowStyleMask::NSFullSizeContentViewWindowMask, | |
true, | |
); | |
ns_window.setStyleMask_(style_mask); |
let id = self.ns_window() as cocoa::base::id; | ||
let mut style_mask = id.styleMask(); | ||
style_mask.set( | ||
NSWindowStyleMask::NSFullSizeContentViewWindowMask, | ||
transparent, | ||
); | ||
self.ns_window.setStyleMask_(style_mask); |
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 shouldn't be the responsibility of this method, it should probably be split into another method WindowExtMacOS::set_fullsize_content_view
"tao": patch | ||
--- | ||
|
||
Fix macOS `WindowBuilderExtMacOS::with_titlebar_transparent` |
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.
I don't think it was broken in the first place, because it seems like users needed to just pair it with WindowBuilderExtMacOS::with_fullsize_content_view
in wry/tauri apps.
Alright, looks like tao already supports what would be needed for making titlebars transparent: |
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
Checklist
fix: remove a typo, closes #___, #___
)Other information
Used @JonasKruckenberg's code from tauri-apps/tauri#2663, and it looks like it works!
Fixes
with_titlebar_transparent
by setting a style mask, and addsWindowExtMacOS::set_titlebar_transparent