Skip to content
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: add WCO title bar style setters #33066

Merged
merged 2 commits into from Mar 25, 2022
Merged

Conversation

clavin
Copy link
Member

@clavin clavin commented Feb 24, 2022

Description of Change

This PR adds a new API to BrowserWindow to change the style of the window controls on a WCO-enabled window (only on Windows):

  • BrowserWindow#setTitleBarOverlay(options: TitleBarOverlay): void

The options parameter mimics the options object in the BrowserWindow constructor. That said, the BrowserWindow constructor also accepts a boolean value, which this method does not! At least not right now, that is. Being able to toggle the titlebar overlay on and off on an already-constructed window might require a substantial refactor to recreate/adjust the entire window view hierarchy and modify the native window. Instead, I'm forgoing the toggle so I can just implement what is necessary to adjust the style of the titlebar overlay. This method is can be augmented in the future to add that functionality (that is, this API is future-compatible) if it is ever desired.

Checklist

Release Notes

Notes: Added BrowserWindow method to change the button color, symbol color, and height of a window with WCO enabled.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Feb 24, 2022
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Mar 3, 2022
@clavin clavin force-pushed the clavin/wco-customization-setters branch 5 times, most recently from 2a10588 to 16283b5 Compare March 9, 2022 18:19
@clavin clavin force-pushed the clavin/wco-customization-setters branch 2 times, most recently from 6fbac24 to e41a4e2 Compare March 17, 2022 21:05
@clavin clavin marked this pull request as ready for review March 17, 2022 21:06
@clavin clavin requested a review from mlaurencin March 17, 2022 21:12
@clavin clavin force-pushed the clavin/wco-customization-setters branch from e41a4e2 to 71324b2 Compare March 18, 2022 22:25
Copy link
Member

@zcbenz zcbenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

Copy link
Contributor

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

@jkleinsc jkleinsc merged commit f69b59e into main Mar 25, 2022
@jkleinsc jkleinsc deleted the clavin/wco-customization-setters branch March 25, 2022 00:02
@release-clerk
Copy link

release-clerk bot commented Mar 25, 2022

Release Notes Persisted

Added BrowserWindow method to change the button color, symbol color, and height of a window with WCO enabled.

@trop
Copy link
Contributor

trop bot commented Mar 25, 2022

I have automatically backported this PR to "17-x-y", please check out #33439

@trop
Copy link
Contributor

trop bot commented Mar 25, 2022

I have automatically backported this PR to "18-x-y", please check out #33440

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Mar 25, 2022
bavulapati pushed a commit to bavulapati/electron that referenced this pull request Apr 29, 2022
* feat: add wco title bar style setters

* return after throwing
khalwa pushed a commit to solarwindscloud/electron that referenced this pull request Feb 22, 2023
* feat: add wco title bar style setters

* return after throwing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review/approved ✅ semver/minor backwards-compatible functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants