diff --git a/desktop/app/src/init.tsx b/desktop/app/src/init.tsx index 573010f34..5b5822a82 100644 --- a/desktop/app/src/init.tsx +++ b/desktop/app/src/init.tsx @@ -50,6 +50,7 @@ import {CopyOutlined} from '@ant-design/icons'; import {clipboard} from 'electron/common'; import {getVersionString} from './utils/versionString'; import {PersistGate} from 'redux-persist/integration/react'; +import {ipcRenderer} from 'electron'; if (process.env.NODE_ENV === 'development' && os.platform() === 'darwin') { // By default Node.JS has its internal certificate storage and doesn't use @@ -222,6 +223,7 @@ function init() { ( document.getElementById('flipper-theme-import') as HTMLLinkElement ).href = `themes/${theme.dark ? 'dark' : 'light'}.css`; + ipcRenderer.send('setTheme', theme.dark ? 'dark' : 'light'); }, ); } diff --git a/desktop/static/main.ts b/desktop/static/main.ts index d52dc9ae8..736495dd6 100644 --- a/desktop/static/main.ts +++ b/desktop/static/main.ts @@ -17,6 +17,7 @@ import { Notification, globalShortcut, session, + nativeTheme, } from 'electron'; import os from 'os'; import path from 'path'; @@ -268,6 +269,11 @@ ipcMain.on('getLaunchTime', (event) => { } }); +ipcMain.on('setTheme', (_e, mode: 'light' | 'dark') => { + console.log('Switching to theme ' + mode); + nativeTheme.themeSource = mode; +}); + ipcMain.on( 'sendNotification', (e, {payload, pluginNotification, closeAfter}) => { diff --git a/desktop/themes/dark.less b/desktop/themes/dark.less index af128f2eb..e0ffeab1f 100644 --- a/desktop/themes/dark.less +++ b/desktop/themes/dark.less @@ -46,3 +46,8 @@ // Divider color @divider-color: #181818; // white 10% + +::-webkit-scrollbar { width: 8px;} +::-webkit-scrollbar-track-piece { background-color: transparent; } +::-webkit-scrollbar-thumb { height: 50px; background-color: rgba(255, 255, 255, 0.5); border-radius: 3px;} +::-webkit-scrollbar-thumb:hover {background-color: rgba(255, 255, 255, 0.7);}