1
0
mirror of https://github.com/kremalicious/blowfish.git synced 2024-12-27 15:17:51 +01:00

fix initial accent color

This commit is contained in:
Matthias Kretschmann 2020-02-09 21:45:59 +01:00
parent c70bc0d984
commit 77d02fe45e
Signed by: m
GPG Key ID: 606EEEF3C479A91F
5 changed files with 20 additions and 24 deletions

View File

@ -80,18 +80,20 @@ const createWindow = async () => {
app.on('ready', async () => {
await prepareNext('./src/renderer')
createWindow()
await createWindow()
mainWindow.webContents.on('dom-ready', () => {
switchTheme()
switchAccentColor()
// add platform as class
mainWindow.webContents.executeJavaScript(
`document.getElementsByTagName('html')[0].classList.add('${process.platform}')`
)
})
mainWindow.webContents.on('did-finish-load', () => {
switchAccentColor()
})
})
// Quit when all windows are closed.

View File

@ -8,7 +8,7 @@ const createButton = (
value,
key,
mainWindow,
accentColor,
accentColor = '#f6388a',
currentCurrency = 'ocean'
) =>
new TouchBarButton({

View File

@ -6,12 +6,6 @@ import Router from 'next/router'
import '../global.css'
import Layout from '../Layout'
//
// Disable zooming
//
// webFrame.setVisualZoomLevelLimits(1, 1)
// webFrame.setLayoutZoomLevelLimits(0, 0)
export default function App({ Component, pageProps }) {
useEffect(() => {
global.ipcRenderer.on('goTo', (evt, route) => {

View File

@ -3,16 +3,16 @@ import Link from 'next/link'
import AccountsList from '../components/AccountsList'
import styles from './preferences.module.css'
const Preferences = () => (
<div className={styles.preferences}>
<h1 className={styles.title}>Preferences</h1>{' '}
<Link href="/">
<a className={styles.close} title="Close Preferences">
&times;
</a>
</Link>
<AccountsList />
</div>
)
export default Preferences
export default function Preferences() {
return (
<div className={styles.preferences}>
<h1 className={styles.title}>Preferences</h1>{' '}
<Link href="/">
<a className={styles.close} title="Close Preferences">
&times;
</a>
</Link>
<AccountsList />
</div>
)
}

View File

@ -38,7 +38,7 @@ export default class AppProvider extends PureComponent {
async componentDidMount() {
// listener for accent color
global.ipcRenderer.on('accent-color', (event, accentColor) => {
global.ipcRenderer.on('accent-color', (evt, accentColor) => {
this.setState({ accentColor })
})