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

Add window opacity support #10667

Merged
merged 4 commits into from Oct 4, 2017

Conversation

Projects
None yet
3 participants
@dittos
Copy link
Contributor

dittos commented Oct 1, 2017

This PR adds support for controlling the opacity of BrowserWindow. It makes the entire window transparent - including system window borders.

Implemented on Windows and macOS.

@dittos dittos requested review from electron/docs as code owners Oct 1, 2017

@welcome

This comment has been minimized.

Copy link

welcome bot commented Oct 1, 2017

💖 Thanks for opening this pull request! 💖

Here is a list of things that will help get it across the finish line:

  • Follow the JavaScript, C++, and Python coding style.
  • Run npm run lint locally to catch formatting errors earlier.
  • Document any user-facing changes you've made following the documentation styleguide.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.
    We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.
@@ -205,6 +205,8 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
`#FFF` (white).
* `hasShadow` Boolean (optional) - Whether window should have a shadow. This is only
implemented on macOS. Default is `true`.
* `opacity` Double (optional) - Set the initial opacity of the window, between 0.0 (fully

This comment has been minimized.

@MarshallOfSound

MarshallOfSound Oct 1, 2017

Member

Type should just be Number (JS doesn't really have different types 😄 )

This comment has been minimized.

@dittos

dittos Oct 2, 2017

Author Contributor

I used Double here because it is used elsewhere several times. https://github.com/electron/electron/search?l=Markdown&q=double&type=&utf8=%E2%9C%93

This comment has been minimized.

@MarshallOfSound

MarshallOfSound Oct 2, 2017

Member

Yeah, not saying all our docs exactly follow what should be going on (we have a lot of docs 😆 ), but news ones should follow the style guide so that our ts converter has an easier job

@@ -631,6 +631,10 @@ bool Window::HasShadow() {
return window_->HasShadow();
}

void Window::SetOpacity(const double opacity) {

This comment has been minimized.

@MarshallOfSound

MarshallOfSound Oct 1, 2017

Member

For consistency with other API's we should probably have a GetOpacity as well 👍

@MarshallOfSound

This comment has been minimized.

Copy link
Member

MarshallOfSound commented Oct 1, 2017

Also there are a few linting issues, make sure to do a quick npm run lint before pushing up 👍

@zcbenz

zcbenz approved these changes Oct 4, 2017

@zcbenz zcbenz merged commit 8c5bb59 into electron:master Oct 4, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@welcome

This comment has been minimized.

Copy link

welcome bot commented Oct 4, 2017

Congrats on merging your first pull request! 🎉🎉🎉

@lucleray lucleray referenced this pull request May 12, 2018

Closed

Background transparency not working as expected. #1556

2 of 2 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment