fix: systemPreferences.getAccentColor inverted color (#48624)
fix: systemPreferences.getAccentColor inverted color Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
parent
90674e0b7b
commit
e3715b0538
2 changed files with 11 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { app, BrowserWindow, BrowserView, dialog, ipcMain, OnBeforeSendHeadersListenerDetails, net, protocol, screen, webContents, webFrameMain, session, WebContents, WebFrameMain } from 'electron/main';
|
||||
import { app, BrowserWindow, BrowserView, dialog, ipcMain, OnBeforeSendHeadersListenerDetails, net, protocol, screen, webContents, webFrameMain, session, systemPreferences, WebContents, WebFrameMain } from 'electron/main';
|
||||
|
||||
import { expect } from 'chai';
|
||||
|
||||
|
|
@ -2590,6 +2590,14 @@ describe('BrowserWindow module', () => {
|
|||
expect(accentColor).to.match(/^#[0-9A-F]{6}$/i);
|
||||
});
|
||||
|
||||
it('matches the systemPreferences system color when true', () => {
|
||||
const w = new BrowserWindow({ show: false });
|
||||
w.setAccentColor(true);
|
||||
const accentColor = w.getAccentColor() as string;
|
||||
const systemColor = systemPreferences.getAccentColor().slice(0, 6);
|
||||
expect(accentColor).to.equal(`#${systemColor}`);
|
||||
});
|
||||
|
||||
it('returns the correct accent color after multiple changes', () => {
|
||||
const w = new BrowserWindow({ show: false });
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue