close frame unchecks use capture frame, gif only scales down never up, gif preview updates when settings change
This commit is contained in:
+8
-1
@@ -2,7 +2,7 @@
|
||||
import { onMount } from "svelte"
|
||||
import { api, convertFileSrc, formatBytes, type Config, type Format, type GifBudgetMode, type GifDither, type RecordedClip, type ExportResult, type CaptureRect } from "./api"
|
||||
import { save } from "@tauri-apps/plugin-dialog"
|
||||
import { emit } from "@tauri-apps/api/event"
|
||||
import { emit, listen } from "@tauri-apps/api/event"
|
||||
|
||||
type Phase = "idle" | "recording" | "paused" | "editing" | "exporting" | "done"
|
||||
|
||||
@@ -111,8 +111,12 @@
|
||||
let unlistenHotkey: (() => void) | null = null
|
||||
let unlistenProgress: (() => void) | null = null
|
||||
let unlistenAudio: (() => void) | null = null
|
||||
let unlistenOverlayClosed: (() => void) | null = null
|
||||
|
||||
void (async () => {
|
||||
unlistenOverlayClosed = await listen("overlay-closed", () => {
|
||||
useFrame = false
|
||||
})
|
||||
config = await api.getConfig()
|
||||
format = config.export.default_format
|
||||
fps = config.capture.default_fps
|
||||
@@ -139,6 +143,7 @@
|
||||
unlistenHotkey?.()
|
||||
unlistenProgress?.()
|
||||
unlistenAudio?.()
|
||||
unlistenOverlayClosed?.()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -362,6 +367,8 @@
|
||||
|
||||
$effect(() => {
|
||||
if (phase === "editing" && format) {
|
||||
// Read these so the effect re-runs when they change
|
||||
const _deps = format === "gif" ? `${gifBudgetMode}-${gifDither}-${gifColors}-${fps}-${targetMB}` : `${fps}-${targetMB}`
|
||||
const timer = window.setTimeout(() => { void refreshPreview() }, 300)
|
||||
return () => { clearTimeout(timer) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user