output folder setting in Settings
This commit is contained in:
+43
-2
@@ -2,6 +2,7 @@
|
||||
import { onMount } from "svelte"
|
||||
import { api, type Config } from "./api"
|
||||
import HotkeyInput from "./HotkeyInput.svelte"
|
||||
import { open } from "@tauri-apps/plugin-dialog"
|
||||
|
||||
let { onClose }: { onClose: () => void } = $props()
|
||||
|
||||
@@ -22,6 +23,17 @@
|
||||
saving = false
|
||||
}
|
||||
}
|
||||
|
||||
async function pickOutputDir() {
|
||||
if (!cfg) return
|
||||
const picked = await open({
|
||||
directory: true,
|
||||
defaultPath: cfg.output_dir ?? undefined,
|
||||
})
|
||||
if (typeof picked === "string") {
|
||||
cfg.output_dir = picked
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<main>
|
||||
@@ -102,6 +114,25 @@
|
||||
</label>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>output</h2>
|
||||
<label>
|
||||
<span>save folder</span>
|
||||
<div class="path-input">
|
||||
<input
|
||||
type="text"
|
||||
placeholder="default: ./output next to the app"
|
||||
value={cfg.output_dir ?? ""}
|
||||
oninput={(e) => {
|
||||
const v = (e.currentTarget as HTMLInputElement).value
|
||||
if (cfg) cfg.output_dir = v.trim() ? v : null
|
||||
}}
|
||||
/>
|
||||
<button class="small" onclick={pickOutputDir}>browse...</button>
|
||||
</div>
|
||||
</label>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>updates</h2>
|
||||
<label class="check">
|
||||
@@ -163,7 +194,7 @@
|
||||
label.check {
|
||||
grid-template-columns: 20px 1fr;
|
||||
}
|
||||
select {
|
||||
select, input[type="text"] {
|
||||
font: inherit;
|
||||
padding: 0.4rem 0.6rem;
|
||||
border: 1px solid #444;
|
||||
@@ -171,10 +202,20 @@
|
||||
color: inherit;
|
||||
border-radius: 4px;
|
||||
}
|
||||
select:focus {
|
||||
select:focus, input[type="text"]:focus {
|
||||
outline: none;
|
||||
border-color: #4a8;
|
||||
}
|
||||
.path-input {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr auto;
|
||||
gap: 0.4rem;
|
||||
width: 100%;
|
||||
}
|
||||
.small {
|
||||
padding: 0.25rem 0.5rem;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
.row {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
|
||||
Reference in New Issue
Block a user