fix problem with title bar #1435

pull/1437/head
Mikael Finstad 4 years ago
parent 633c068aa5
commit 5f8107de98
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26

@ -61,7 +61,7 @@ import { shouldCopyStreamByDefault, getAudioStreams, getRealVideoStreams, isAudi
import { exportEdlFile, readEdlFile, saveLlcProject, loadLlcProject, askForEdlImport } from './edlStore'; import { exportEdlFile, readEdlFile, saveLlcProject, loadLlcProject, askForEdlImport } from './edlStore';
import { formatYouTube, getFrameCountRaw } from './edlFormats'; import { formatYouTube, getFrameCountRaw } from './edlFormats';
import { import {
getOutPath, getSuffixedOutPath, toast, errorToast, handleError, setFileNameTitle, getOutDir, getFileDir, getOutPath, getSuffixedOutPath, toast, errorToast, handleError, getOutDir, getFileDir,
checkDirWriteAccess, dirExists, isMasBuild, isStoreBuild, dragPreventer, checkDirWriteAccess, dirExists, isMasBuild, isStoreBuild, dragPreventer,
filenamify, getOutFileExtension, generateSegFileName, defaultOutSegTemplate, filenamify, getOutFileExtension, generateSegFileName, defaultOutSegTemplate,
havePermissionToReadFile, resolvePathIfNeeded, getPathReadAccessError, html5ifiedPrefix, html5dummySuffix, findExistingHtml5FriendlyFile, havePermissionToReadFile, resolvePathIfNeeded, getPathReadAccessError, html5ifiedPrefix, html5dummySuffix, findExistingHtml5FriendlyFile,
@ -202,14 +202,14 @@ const App = memo(() => {
}, []); }, []);
useEffect(() => { useEffect(() => {
if (!working || cutProgress == null) setDocumentExtraTitle(); const parts = [];
else { if (filePath) parts.push(basename(filePath));
const parts = []; if (working) {
if (working) parts.push(working); parts.push('-', working);
if (cutProgress != null) parts.push(`${(cutProgress * 100).toFixed(1)}%`); if (cutProgress != null) parts.push(`${(cutProgress * 100).toFixed(1)}%`);
setDocumentExtraTitle(parts.join(' '));
} }
}, [cutProgress, working]); setDocumentExtraTitle(parts.length > 0 ? parts.join(' ') : undefined);
}, [cutProgress, filePath, working]);
const zoom = Math.floor(zoomUnrounded); const zoom = Math.floor(zoomUnrounded);
@ -918,7 +918,6 @@ const App = memo(() => {
video.playbackRate = 1; video.playbackRate = 1;
// setWorking(); // setWorking();
setFileNameTitle();
setPreviewFilePath(); setPreviewFilePath();
setUsingDummyVideo(false); setUsingDummyVideo(false);
setPlaying(false); setPlaying(false);
@ -1645,7 +1644,6 @@ const App = memo(() => {
setMainVideoStream(videoStream); setMainVideoStream(videoStream);
setMainAudioStream(audioStream); setMainAudioStream(audioStream);
setCopyStreamIdsForPath(fp, () => copyStreamIdsForPathNew); setCopyStreamIdsForPath(fp, () => copyStreamIdsForPathNew);
setFileNameTitle(fp);
setFileFormat(outFormatLocked || fileFormatNew); setFileFormat(outFormatLocked || fileFormatNew);
setDetectedFileFormat(fileFormatNew); setDetectedFileFormat(fileFormatNew);

@ -6,7 +6,7 @@ import ky from 'ky';
import isDev from './isDev'; import isDev from './isDev';
const { dirname, parse: parsePath, join, basename, extname, isAbsolute, resolve } = window.require('path'); const { dirname, parse: parsePath, join, extname, isAbsolute, resolve } = window.require('path');
const fs = window.require('fs-extra'); const fs = window.require('fs-extra');
const os = window.require('os'); const os = window.require('os');
const { ipcRenderer } = window.require('electron'); const { ipcRenderer } = window.require('electron');
@ -135,11 +135,6 @@ export function handleError(arg1, arg2) {
}); });
} }
export function setFileNameTitle(filePath) {
const appName = 'LosslessCut';
document.title = filePath ? `${appName} - ${basename(filePath)}` : appName;
}
export function filenamify(name) { export function filenamify(name) {
return name.replace(/[^0-9a-zA-Z_\-.]/g, '_'); return name.replace(/[^0-9a-zA-Z_\-.]/g, '_');
} }

Loading…
Cancel
Save