From 1abf243735ff7f26d168cadf32b8bf0978c7ba3f Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Tue, 6 Aug 2024 21:16:39 +0200 Subject: [PATCH] implement task bar progress closes #1511 --- src/main/index.ts | 2 ++ src/renderer/src/App.tsx | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/index.ts b/src/main/index.ts index abf9e3c6..15327751 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -406,3 +406,5 @@ export function quitApp() { } export const hasDisabledNetworking = () => !!disableNetworking; + +export const setProgressBar = (v: number) => mainWindow?.setProgressBar(v); diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index 830d64fd..33d60531 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -97,7 +97,7 @@ const { exists } = window.require('fs-extra'); const { lstat } = window.require('fs/promises'); const { parse: parsePath, join: pathJoin, basename, dirname } = window.require('path'); -const { focusWindow, hasDisabledNetworking, quitApp, pathToFileURL } = window.require('@electron/remote').require('./index.js'); +const { focusWindow, hasDisabledNetworking, quitApp, pathToFileURL, setProgressBar } = window.require('@electron/remote').require('./index.js'); const videoStyle: CSSProperties = { width: '100%', height: '100%', objectFit: 'contain' }; @@ -191,6 +191,8 @@ function App() { useEffect(() => setDocumentTitle({ filePath, working: working?.text, cutProgress }), [cutProgress, filePath, working?.text]); + useEffect(() => setProgressBar(cutProgress ?? -1), [cutProgress]); + const zoom = Math.floor(zoomUnrounded); const durationSafe = isDurationValid(duration) ? duration : 1;