refactor(WindowService, ThemeProvider): streamline title bar style and theme toggling logic (#5633)

* fix(config): update title bar overlay colors for better visibility

* fix(Navbar): add Linux support for padding adjustment in Navbar component
This commit is contained in:
beyondkmp 2025-05-04 13:19:56 +08:00 committed by GitHub
parent 6e9bde6b6d
commit 3718b86044
3 changed files with 6 additions and 6 deletions

View File

@ -12,12 +12,12 @@ export const DATA_PATH = getDataPath()
export const titleBarOverlayDark = {
height: 40,
color: 'rgba(0,0,0,0)',
symbolColor: '#ffffff'
color: 'rgba(255,255,255,0)',
symbolColor: '#fff'
}
export const titleBarOverlayLight = {
height: 40,
color: 'rgba(255,255,255,0)',
symbolColor: '#000000'
symbolColor: '#000'
}

View File

@ -64,7 +64,7 @@ export class WindowService {
transparent: isMac,
vibrancy: 'sidebar',
visualEffectState: 'active',
titleBarStyle: isLinux ? 'default' : 'hidden',
titleBarStyle: 'hidden',
titleBarOverlay: nativeTheme.shouldUseDarkColors ? titleBarOverlayDark : titleBarOverlayLight,
backgroundColor: isMac ? undefined : nativeTheme.shouldUseDarkColors ? '#181818' : '#FFFFFF',
darkTheme: nativeTheme.shouldUseDarkColors,

View File

@ -1,4 +1,4 @@
import { isMac, isWindows } from '@renderer/config/constant'
import { isLinux, isMac, isWindows } from '@renderer/config/constant'
import useNavBackgroundColor from '@renderer/hooks/useNavBackgroundColor'
import type { FC, PropsWithChildren } from 'react'
import type { HTMLAttributes } from 'react'
@ -63,6 +63,6 @@ const NavbarRightContainer = styled.div`
display: flex;
align-items: center;
padding: 0 12px;
padding-right: ${isWindows ? '140px' : 12};
padding-right: ${isWindows ? '140px' : isLinux ? '120px' : '12px'};
justify-content: flex-end;
`