Use native dark theme titlebar on Windows

This commit is contained in:
Fedor Indutny 2024-01-16 22:32:38 +01:00 committed by GitHub
parent b574ba531d
commit 23e3883ce0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 152 additions and 965 deletions

View file

@ -22,7 +22,6 @@ function createIsPlatform(
export type OSType = {
getClassName: () => string;
getName: () => string;
hasCustomTitleBar: () => boolean;
isLinux: (minVersion?: string) => boolean;
isMacOS: (minVersion?: string) => boolean;
isWindows: (minVersion?: string) => boolean;
@ -33,10 +32,6 @@ export function getOSFunctions(osRelease: string): OSType {
const isLinux = createIsPlatform('linux', osRelease);
const isWindows = createIsPlatform('win32', osRelease);
// Windows 10 and above
const hasCustomTitleBar = (): boolean =>
isWindows('10.0.0') || Boolean(process.env.CUSTOM_TITLEBAR);
const getName = (): string => {
if (isMacOS()) {
return 'macOS';
@ -60,7 +55,6 @@ export function getOSFunctions(osRelease: string): OSType {
return {
getClassName,
getName,
hasCustomTitleBar,
isLinux,
isMacOS,
isWindows,