-
-
Notifications
You must be signed in to change notification settings - Fork 197
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(window): expose a few more window-options #968
Conversation
I have updated your lock dirs and formatted the code. |
I'm not sure what to do about the transparency-flag. I think it makes sense to expose it for full opacity, but perhaps we should name it something else as to reserve it for pure background-transparency? |
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.
Apart from the minor issues noted below, this looks good to me!
src/Core/WindowCreateOptions.re
Outdated
@@ -72,10 +84,13 @@ let create = | |||
~maximized=false, | |||
~decorated=true, | |||
~titlebarStyle=WindowStyles.System, | |||
~transparency=1.0, |
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 sets the opacity, not transparency, which is its inverse. Fully transparent means it's see-through, while fully opaque means it's solid.
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.
Ah, that's true! Switch our naming to opacity
and leave a comment perhaps?
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.
Yeah, that sounds good!
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.
Updated, let me know if you think we're good to go!
Since it's associated with the window, I don't think it''s a problem. Background transparency would instead be associated with painting I think. |
Co-authored-by: Glenn Slotte <[email protected]>
Co-authored-by: Glenn Slotte <[email protected]>
Co-authored-by: Glenn Slotte <[email protected]>
Co-authored-by: Glenn Slotte <[email protected]>
Co-authored-by: Glenn Slotte <[email protected]>
Co-authored-by: Glenn Slotte <[email protected]>
Thanks for reviewing and the suggested changes @glennsl! |
// Sdl2 has this named as Transparency, but it actually works as opacity | ||
// where a value of 1.0 means it's fully opaque | ||
Sdl2.Window.setTransparency(sdlWindow, options.opacity); |
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.
SDL2 actually has it right. It's reason-sdl
that gets it wrong. And since reason-sdl
is in this repo we could fix it completely in this PR.
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.
Must have missed this!
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.
Thanks for the fixes @lessp. Looks great!
/** | ||
[opacity] sets the opacity of the window. | ||
A value of 1.0 means the window is fully opaque, | ||
and a value of 0.0 means the window is completely 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.
💯
This adds a
transparency
-option to Window.EDIT: I guess though, that this puts a transparency on everything, not only the "background-window" as you'd expect. 🤔
Would close #506