The swiss army knife of lossless video/audio editing
allow disabling remember window position
Mikael Finstad19a39fd1bed4
diff --git a/src/main/configStore.ts b/src/main/configStore.tsindex 42d97a12..b07ed641 100644--- a/src/main/configStore.ts+++ b/src/main/configStore.ts@@ -150,6 +150,7 @@ const defaults: Config = {outputFileNameMinZeroPadding: 1,cutFromAdjustmentFrames: 0,invertTimelineScroll: undefined,+ storeWindowBounds: true,};const configFileName = 'config.json'; // note: this is also hard-coded inside electron-storediff --git a/src/main/index.ts b/src/main/index.tsindex 5649d881..0d36cc0d 100644--- a/src/main/index.ts+++ b/src/main/index.ts@@ -189,7 +189,7 @@ function createWindow() {});const debouncedSaveWindowState = debounce(() => {- if (!mainWindow) return;+ if (!mainWindow || !configStore.get('storeWindowBounds')) return;const { x, y, width, height } = mainWindow.getNormalBounds();configStore.set('windowBounds', { x, y, width, height });}, 500);diff --git a/src/renderer/src/components/Settings.tsx b/src/renderer/src/components/Settings.tsxindex f664c629..41fb77c1 100644--- a/src/renderer/src/components/Settings.tsx+++ b/src/renderer/src/components/Settings.tsx@@ -73,7 +73,7 @@ function Settings({const { t } = useTranslation();const [showAdvanced, setShowAdvanced] = useState(!simpleMode);- const { customOutDir, changeOutDir, keyframeCut, toggleKeyframeCut, timecodeFormat, setTimecodeFormat, invertCutSegments, setInvertCutSegments, askBeforeClose, setAskBeforeClose, enableAskForImportChapters, setEnableAskForImportChapters, enableAskForFileOpenAction, setEnableAskForFileOpenAction, autoSaveProjectFile, setAutoSaveProjectFile, invertTimelineScroll, setInvertTimelineScroll, language, setLanguage, hideNotifications, setHideNotifications, hideOsNotifications, setHideOsNotifications, autoLoadTimecode, setAutoLoadTimecode, enableAutoHtml5ify, setEnableAutoHtml5ify, customFfPath, setCustomFfPath, storeProjectInWorkingDir, mouseWheelZoomModifierKey, setMouseWheelZoomModifierKey, mouseWheelFrameSeekModifierKey, setMouseWheelFrameSeekModifierKey, mouseWheelKeyframeSeekModifierKey, setMouseWheelKeyframeSeekModifierKey, captureFrameMethod, setCaptureFrameMethod, captureFrameQuality, setCaptureFrameQuality, captureFrameFileNameFormat, setCaptureFrameFileNameFormat, enableNativeHevc, setEnableNativeHevc, enableUpdateCheck, setEnableUpdateCheck, allowMultipleInstances, setAllowMultipleInstances, preferStrongColors, setPreferStrongColors, treatInputFileModifiedTimeAsStart, setTreatInputFileModifiedTimeAsStart, treatOutputFileModifiedTimeAsStart, setTreatOutputFileModifiedTimeAsStart, exportConfirmEnabled, toggleExportConfirmEnabled } = useUserSettings();+ const { customOutDir, changeOutDir, keyframeCut, toggleKeyframeCut, timecodeFormat, setTimecodeFormat, invertCutSegments, setInvertCutSegments, askBeforeClose, setAskBeforeClose, enableAskForImportChapters, setEnableAskForImportChapters, enableAskForFileOpenAction, setEnableAskForFileOpenAction, autoSaveProjectFile, setAutoSaveProjectFile, invertTimelineScroll, setInvertTimelineScroll, language, setLanguage, hideNotifications, setHideNotifications, hideOsNotifications, setHideOsNotifications, autoLoadTimecode, setAutoLoadTimecode, enableAutoHtml5ify, setEnableAutoHtml5ify, customFfPath, setCustomFfPath, storeProjectInWorkingDir, mouseWheelZoomModifierKey, setMouseWheelZoomModifierKey, mouseWheelFrameSeekModifierKey, setMouseWheelFrameSeekModifierKey, mouseWheelKeyframeSeekModifierKey, setMouseWheelKeyframeSeekModifierKey, captureFrameMethod, setCaptureFrameMethod, captureFrameQuality, setCaptureFrameQuality, captureFrameFileNameFormat, setCaptureFrameFileNameFormat, enableNativeHevc, setEnableNativeHevc, enableUpdateCheck, setEnableUpdateCheck, allowMultipleInstances, setAllowMultipleInstances, preferStrongColors, setPreferStrongColors, treatInputFileModifiedTimeAsStart, setTreatInputFileModifiedTimeAsStart, treatOutputFileModifiedTimeAsStart, setTreatOutputFileModifiedTimeAsStart, exportConfirmEnabled, toggleExportConfirmEnabled, storeWindowBounds, setStoreWindowBounds } = useUserSettings();const onLangChange = useCallback<ChangeEventHandler<HTMLSelectElement>>((e) => {const { value } = e.target;@@ -425,6 +425,15 @@ function Settings({<Header title={t('User interface')} />+ {showAdvanced && (+ <Row>+ <KeyCell>{t('Remember window size and position')}</KeyCell>+ <td>+ <Switch checked={storeWindowBounds} onCheckedChange={setStoreWindowBounds} />+ </td>+ </Row>+ )}+{showAdvanced && (<Row><KeyCell>{t('Auto load timecode from file as an offset in the timeline?')}</KeyCell>diff --git a/src/renderer/src/hooks/useUserSettingsRoot.ts b/src/renderer/src/hooks/useUserSettingsRoot.tsindex 73bb0086..b7cc288b 100644--- a/src/renderer/src/hooks/useUserSettingsRoot.ts+++ b/src/renderer/src/hooks/useUserSettingsRoot.ts@@ -163,6 +163,8 @@ export default () => {useEffect(() => safeSetConfig({ outputFileNameMinZeroPadding }), [outputFileNameMinZeroPadding]);const [cutFromAdjustmentFrames, setCutFromAdjustmentFrames] = useState(safeGetConfigInitial('cutFromAdjustmentFrames'));useEffect(() => safeSetConfig({ cutFromAdjustmentFrames }), [cutFromAdjustmentFrames]);+ const [storeWindowBounds, setStoreWindowBounds] = useState(safeGetConfigInitial('storeWindowBounds'));+ useEffect(() => safeSetConfig({ storeWindowBounds }), [storeWindowBounds]);const resetKeyBindings = useCallback(() => {configStore.reset('keyBindings');@@ -299,5 +301,7 @@ export default () => {setOutputFileNameMinZeroPadding,cutFromAdjustmentFrames,setCutFromAdjustmentFrames,+ storeWindowBounds,+ setStoreWindowBounds,};};diff --git a/types.ts b/types.tsindex 00ea4e64..b08ad2a6 100644--- a/types.ts+++ b/types.ts@@ -89,6 +89,7 @@ export interface Config {outFormatLocked: string | undefined,safeOutputFileName: boolean,windowBounds: { x: number, y: number, width: number, height: number } | undefined,+ storeWindowBounds: boolean,enableAutoHtml5ify: boolean,keyBindings: KeyBinding[],customFfPath: string | undefined,