aspect ratio presets for capture frame

This commit is contained in:
2026-05-12 01:40:27 +03:00
parent 63e41297e9
commit c1d474325f
3 changed files with 40 additions and 1 deletions
+22 -1
View File
@@ -271,10 +271,20 @@
capture frame: {useFrame ? "on" : "off"}
</button>
</section>
{#if useFrame}
<div class="presets">
<span class="presets-label">preset:</span>
<button class="small" onclick={() => api.setOverlaySize(1280, 720)}>720p</button>
<button class="small" onclick={() => api.setOverlaySize(1920, 1080)}>1080p</button>
<button class="small" onclick={() => api.setOverlaySize(800, 800)}>1:1</button>
<button class="small" onclick={() => api.setOverlaySize(540, 960)}>9:16</button>
</div>
{/if}
<p class="hint">
{#if useFrame}
The green frame stays visible during recording but is excluded from
the capture itself. Drag it to position the region.
the capture itself. Drag it to position the region, or pick a preset
above for common dimensions.
{:else}
Captures your full primary monitor. Toggle the capture frame on to
record a region instead.
@@ -617,6 +627,17 @@
border-color: #4a8;
color: #4a8;
}
.presets {
display: flex;
align-items: center;
gap: 0.4rem;
margin: 0.75rem 0 0;
justify-content: center;
}
.presets-label {
font-size: 0.8rem;
color: #888;
}
button.stop {
background: #c33;
border-color: #c33;
+2
View File
@@ -109,6 +109,8 @@ export const api = {
revealInExplorer: (path: string) => invoke<void>("reveal_in_explorer", { path }),
showOverlay: () => invoke<void>("show_overlay"),
hideOverlay: () => invoke<void>("hide_overlay"),
setOverlaySize: (width: number, height: number) =>
invoke<void>("set_overlay_size", { width, height }),
getOverlayRect: () => invoke<CaptureRect>("get_overlay_rect"),
extractThumbnails: (fps: number) =>
invoke<string[]>("extract_thumbnails", { fps }),