Skip to content

The swiss army knife of lossless video/audio editing

show progress in title

Mikael Finstadf1a9ea0e1da8
diff --git a/src/App.jsx b/src/App.jsx
index 95c7a874..e32c359c 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -97,6 +97,11 @@ const { focusWindow } = remote.require('./electron');
const calcShouldShowWaveform = (zoomedDuration) => (zoomedDuration != null && zoomedDuration < ffmpegExtractWindow * 8);
const calcShouldShowKeyframes = (zoomedDuration) => (zoomedDuration != null && zoomedDuration < ffmpegExtractWindow * 8);
+function setDocumentExtraTitle(extra) {
+ const baseTitle = 'LosslessCut';
+ if (extra != null) document.title = `${baseTitle} - ${extra}`;
+ else document.title = baseTitle;
+}
const videoStyle = { width: '100%', height: '100%', objectFit: 'contain' };
const bottomMotionStyle = { background: controlsBackground };
@@ -196,6 +201,16 @@ const App = memo(() => {
setWorkingState(val);
}, []);
+ useEffect(() => {
+ if (!working || cutProgress == null) setDocumentExtraTitle();
+ else {
+ const parts = [];
+ if (working) parts.push(working);
+ if (cutProgress != null) parts.push(`${(cutProgress * 100).toFixed(1)}%`);
+ setDocumentExtraTitle(parts.join(' '));
+ }
+ }, [cutProgress, working]);
+
const zoom = Math.floor(zoomUnrounded);
const durationSafe = isDurationValid(duration) ? duration : 1;