Support retrieving Windows system colors #7561

Merged
merged 7 commits into from Oct 12, 2016

Projects

None yet

4 participants

@kevinsawicki
Contributor
kevinsawicki commented Oct 11, 2016 edited

Adds a systemPreferences.getColor method on Windows that supports retrieving all the colors from https://msdn.microsoft.com/en-us/library/windows/desktop/ms724371(v=vs.85).aspx

  • Add systemPreferences.getColor
  • Add color-changed event
  • Add specs
  • Add docs

/cc @MarshallOfSound @paulcbetts 👀

Refs #7518

kevinsawicki added some commits Oct 10, 2016
@kevinsawicki kevinsawicki Add ToRGBHex color helper 9b0a32f
@kevinsawicki kevinsawicki Add systemPreferences.getColor on Windows 663f8f4
@kevinsawicki kevinsawicki Add systemPreferences.getColor specs e7bfd1c
@kevinsawicki kevinsawicki Remove duplicate colors 1978b39
@kevinsawicki kevinsawicki Doc systemPreferences.getColor 2656812
@kevinsawicki kevinsawicki Emit color-changed event on Windows c818904
@kevinsawicki kevinsawicki Remove const since SkColor is an int
ce69476
@nikola
nikola commented Oct 12, 2016

Perhaps a note should be added that if users just want to style their HTML/CSS UI in electron using Windows system colors, they don't actually have to use the new interface, but instead they can just write e.g.

myElement {
    border: 1px solid WindowFrame;
    color: WindowText;
}

MDN has a list of supported keywords.

@paulcbetts
Contributor

Perhaps a note should be added that if users just want to style their HTML/CSS UI in electron using Windows system colors, they don't actually have to use the new interface

Chromium hardcodes these values to canned colors, they don't represent any actual theme 😢

@paulcbetts
Contributor

@zcbenz
Contributor
zcbenz commented Oct 12, 2016

👍

@zcbenz zcbenz merged commit 46cd870 into master Oct 12, 2016

9 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
electron-linux-arm Build #4392852 succeeded in 68s
Details
electron-linux-ia32 Build #4392853 succeeded in 58s
Details
electron-linux-x64 Build #4392854 succeeded in 114s
Details
electron-mas-x64 Build #2602 succeeded in 9 min 12 sec
Details
electron-osx-x64 Build #2609 succeeded in 9 min 33 sec
Details
electron-win-ia32 Build #1698 succeeded in 7 min 28 sec
Details
electron-win-x64 Build #1673 succeeded in 8 min 12 sec
Details
@zcbenz zcbenz deleted the windows-system-colors branch Oct 12, 2016
@aluxian-huginn aluxian-huginn referenced this pull request in Aluxian/Messenger-for-Desktop Oct 20, 2016
Closed

Update dependency: electron v1.4.4 #885

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