mirror of
https://github.com/kremalicious/blowfish.git
synced 2024-12-28 07:37:51 +01:00
fix initial accent color
This commit is contained in:
parent
c70bc0d984
commit
77d02fe45e
@ -80,18 +80,20 @@ const createWindow = async () => {
|
|||||||
|
|
||||||
app.on('ready', async () => {
|
app.on('ready', async () => {
|
||||||
await prepareNext('./src/renderer')
|
await prepareNext('./src/renderer')
|
||||||
|
await createWindow()
|
||||||
createWindow()
|
|
||||||
|
|
||||||
mainWindow.webContents.on('dom-ready', () => {
|
mainWindow.webContents.on('dom-ready', () => {
|
||||||
switchTheme()
|
switchTheme()
|
||||||
switchAccentColor()
|
|
||||||
|
|
||||||
// add platform as class
|
// add platform as class
|
||||||
mainWindow.webContents.executeJavaScript(
|
mainWindow.webContents.executeJavaScript(
|
||||||
`document.getElementsByTagName('html')[0].classList.add('${process.platform}')`
|
`document.getElementsByTagName('html')[0].classList.add('${process.platform}')`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
mainWindow.webContents.on('did-finish-load', () => {
|
||||||
|
switchAccentColor()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// Quit when all windows are closed.
|
// Quit when all windows are closed.
|
||||||
|
@ -8,7 +8,7 @@ const createButton = (
|
|||||||
value,
|
value,
|
||||||
key,
|
key,
|
||||||
mainWindow,
|
mainWindow,
|
||||||
accentColor,
|
accentColor = '#f6388a',
|
||||||
currentCurrency = 'ocean'
|
currentCurrency = 'ocean'
|
||||||
) =>
|
) =>
|
||||||
new TouchBarButton({
|
new TouchBarButton({
|
||||||
|
@ -6,12 +6,6 @@ import Router from 'next/router'
|
|||||||
import '../global.css'
|
import '../global.css'
|
||||||
import Layout from '../Layout'
|
import Layout from '../Layout'
|
||||||
|
|
||||||
//
|
|
||||||
// Disable zooming
|
|
||||||
//
|
|
||||||
// webFrame.setVisualZoomLevelLimits(1, 1)
|
|
||||||
// webFrame.setLayoutZoomLevelLimits(0, 0)
|
|
||||||
|
|
||||||
export default function App({ Component, pageProps }) {
|
export default function App({ Component, pageProps }) {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
global.ipcRenderer.on('goTo', (evt, route) => {
|
global.ipcRenderer.on('goTo', (evt, route) => {
|
||||||
|
@ -3,16 +3,16 @@ import Link from 'next/link'
|
|||||||
import AccountsList from '../components/AccountsList'
|
import AccountsList from '../components/AccountsList'
|
||||||
import styles from './preferences.module.css'
|
import styles from './preferences.module.css'
|
||||||
|
|
||||||
const Preferences = () => (
|
export default function Preferences() {
|
||||||
<div className={styles.preferences}>
|
return (
|
||||||
<h1 className={styles.title}>Preferences</h1>{' '}
|
<div className={styles.preferences}>
|
||||||
<Link href="/">
|
<h1 className={styles.title}>Preferences</h1>{' '}
|
||||||
<a className={styles.close} title="Close Preferences">
|
<Link href="/">
|
||||||
×
|
<a className={styles.close} title="Close Preferences">
|
||||||
</a>
|
×
|
||||||
</Link>
|
</a>
|
||||||
<AccountsList />
|
</Link>
|
||||||
</div>
|
<AccountsList />
|
||||||
)
|
</div>
|
||||||
|
)
|
||||||
export default Preferences
|
}
|
||||||
|
@ -38,7 +38,7 @@ export default class AppProvider extends PureComponent {
|
|||||||
|
|
||||||
async componentDidMount() {
|
async componentDidMount() {
|
||||||
// listener for accent color
|
// listener for accent color
|
||||||
global.ipcRenderer.on('accent-color', (event, accentColor) => {
|
global.ipcRenderer.on('accent-color', (evt, accentColor) => {
|
||||||
this.setState({ accentColor })
|
this.setState({ accentColor })
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user