Files
desktop/app/hooks/useWindow.ts
rosetta 83f38dc63f 'init'
2026-01-30 05:01:05 +02:00

30 lines
637 B
TypeScript

// Desc: Custom hook to handle window resizing
export enum ElectronTheme {
SYSTEM = 'system',
DARK = 'dark',
LIGHT = 'light'
}
const useWindow = () => {
const setSize = (width : number, height : number) => {
window.api.send('window-resize', { width: width, height: height });
}
const setResizeble = (isResizeble : boolean) => {
window.api.send('window-resizeble', isResizeble);
}
const setTheme = (theme : ElectronTheme) => {
window.api.send('window-theme', theme);
}
return {
setSize,
setResizeble,
setTheme
}
}
export default useWindow;