Skip to content

Commit

Permalink
Pass down high-contrast theme pref
Browse files Browse the repository at this point in the history
  • Loading branch information
inukshuk committed Nov 19, 2019
1 parent b05bd56 commit d69c953
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion src/browser/tropy.js
Expand Up @@ -921,7 +921,11 @@ class Tropy extends EventEmitter {
if (theme !== nativeTheme.themeSource)
nativeTheme.themeSource = theme

this.wm.broadcast('theme', theme, nativeTheme.shouldUseDarkColors)
this.wm.broadcast('theme', theme, {
dark: nativeTheme.shouldUseDarkColors,
contrast: nativeTheme.shouldUseHighContrastColors
})

this.emit('app:reload-menu')
}

Expand Down
2 changes: 1 addition & 1 deletion src/browser/wm.js
Expand Up @@ -507,7 +507,7 @@ class WindowManager extends EventEmitter {

static getAquaColorVariant() {
return darwin && AQUA[
prefs.getUserDefault('AppleAquaColorVariant', 'integer')
prefs.getUserDefault('AppleAquaColorVariant', 'string')
]
}

Expand Down
8 changes: 4 additions & 4 deletions src/window.js
Expand Up @@ -48,6 +48,7 @@ class Window extends EventEmitter {
'scrollbars',
'theme',
'dark',
'constrast',
'maximizable',
'minimizable'
])
Expand Down Expand Up @@ -137,10 +138,9 @@ class Window extends EventEmitter {
this.toggle(state)
this.emit(state)
})
.on('theme', (_, theme, dark) => {
args.update({ theme, dark })
this.state.theme = theme
this.state.dark = dark
.on('theme', (_, theme, { dark, contrast } = {}) => {
args.update({ theme, dark, contrast })
Object.assign(this.state, { theme, dark, contrast })
this.style(true)
})
.on('recent', (_, recent) => {
Expand Down

0 comments on commit d69c953

Please sign in to comment.