Use patched frameless-titlebar on Windows

This commit is contained in:
Fedor Indutny
2022-06-08 15:00:32 -07:00
committed by GitHub
parent 79c52847cd
commit 5634601554
54 changed files with 1343 additions and 323 deletions
+10
View File
@@ -27,6 +27,7 @@ export type SystemThemeHolder = { systemTheme: SystemThemeType };
export type NativeThemeType = {
getSystemTheme: () => SystemThemeType;
subscribe: (fn: Callback) => void;
unsubscribe: (fn: Callback) => void;
update: () => SystemThemeType;
};
@@ -50,6 +51,14 @@ export function createNativeThemeListener(
subscribers.push(fn);
}
function unsubscribe(fn: Callback): void {
const index = subscribers.indexOf(fn);
if (index !== -1) {
subscribers.splice(index, 1);
}
}
ipc.on(
'native-theme:changed',
(_event: unknown, change: NativeThemeState) => {
@@ -67,6 +76,7 @@ export function createNativeThemeListener(
return {
getSystemTheme: () => systemTheme,
subscribe,
unsubscribe,
update,
};
}