mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
use platform window bar style as default (#150)
This commit is contained in:
@@ -21,6 +21,8 @@ import {
|
|||||||
Platform,
|
Platform,
|
||||||
} from '/@/renderer/types';
|
} from '/@/renderer/types';
|
||||||
|
|
||||||
|
const utils = isElectron() ? window.electron.utils : null;
|
||||||
|
|
||||||
export type SidebarItemType = {
|
export type SidebarItemType = {
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
id: string;
|
id: string;
|
||||||
@@ -169,6 +171,13 @@ export interface SettingsSlice extends SettingsState {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Determines the default/initial windowBarStyle value based on the current platform.
|
||||||
|
const getPlatformDefaultWindowBarStyle = (): Platform => {
|
||||||
|
return isElectron() ? (utils.isMacOS() ? Platform.MACOS : Platform.WINDOWS) : Platform.WEB;
|
||||||
|
};
|
||||||
|
|
||||||
|
const platformDefaultWindowBarStyle: Platform = getPlatformDefaultWindowBarStyle();
|
||||||
|
|
||||||
const initialState: SettingsState = {
|
const initialState: SettingsState = {
|
||||||
general: {
|
general: {
|
||||||
followSystemTheme: false,
|
followSystemTheme: false,
|
||||||
@@ -369,7 +378,7 @@ const initialState: SettingsState = {
|
|||||||
disableAutoUpdate: false,
|
disableAutoUpdate: false,
|
||||||
exitToTray: false,
|
exitToTray: false,
|
||||||
minimizeToTray: false,
|
minimizeToTray: false,
|
||||||
windowBarStyle: isElectron() ? Platform.WINDOWS : Platform.WEB,
|
windowBarStyle: platformDefaultWindowBarStyle,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user