1
0
Fork 0
mirror of https://gitlab.com/futo-org/fcast.git synced 2025-08-04 16:27:02 +00:00

Electron: Added support for changing main window background

This commit is contained in:
Michael Hollister 2025-06-13 15:05:06 -05:00
parent e7168b0a74
commit 62e430c080
5 changed files with 69 additions and 2 deletions

View file

@ -43,6 +43,24 @@ if (TARGET === 'electron') {
preloadData.subscribedKeys.keyUp = value.keyUp;
})
electronAPI.ipcRenderer.on('update-background', (_event, path: string, isVideo: boolean) => {
const imageBackground = document.getElementById('image-background') as HTMLImageElement;
const videoBackground = document.getElementById('video-player') as HTMLVideoElement;
if (isVideo) {
videoBackground.src = path;
imageBackground.style.display = 'none';
videoBackground.style.display = 'block';
}
else {
imageBackground.src = path;
imageBackground.style.display = 'block';
videoBackground.style.display = 'none';
}
})
electronAPI.ipcRenderer.on('toast', (_event, message: string, icon: ToastIcon = ToastIcon.INFO, duration: number = 5000) => {
toast(message, icon, duration);
})

View file

@ -9,6 +9,13 @@ body, html {
overflow: hidden;
}
#image-background {
height: 100%;
width: 100%;
display: none;
object-fit: cover;
}
.video {
height: 100%;
width: 100%;