Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Enable custom cursors by default (#932)

Oscar Beaumont60e76c186073
diff --git a/apps/desktop/src-tauri/src/general_settings.rs b/apps/desktop/src-tauri/src/general_settings.rs
index 9f3d40d66..280d4302e 100644
--- a/apps/desktop/src-tauri/src/general_settings.rs
+++ b/apps/desktop/src-tauri/src/general_settings.rs
@@ -74,7 +74,8 @@ pub struct GeneralSettingsStore {
pub post_studio_recording_behaviour: PostStudioRecordingBehaviour,
#[serde(default)]
pub main_window_recording_start_behaviour: MainWindowRecordingStartBehaviour,
- #[serde(default)]
+ // Renamed from `custom_cursor_capture` to `custom_cursor_capture2` so we can change the default.
+ #[serde(default = "default_true", rename = "custom_cursor_capture2")]
pub custom_cursor_capture: bool,
#[serde(default = "default_server_url")]
pub server_url: String,
@@ -112,6 +113,10 @@ fn no(_: &bool) -> bool {
false
}
+fn default_true() -> bool {
+ true
+}
+
fn default_server_url() -> String {
std::option_env!("VITE_SERVER_URL")
.unwrap_or("https://cap.so")
@@ -144,7 +149,7 @@ impl Default for GeneralSettingsStore {
window_transparency: false,
post_studio_recording_behaviour: PostStudioRecordingBehaviour::OpenEditor,
main_window_recording_start_behaviour: MainWindowRecordingStartBehaviour::Close,
- custom_cursor_capture: false,
+ custom_cursor_capture: true,
server_url: default_server_url(),
recording_countdown: Some(3),
enable_native_camera_preview: default_enable_native_camera_preview(),
diff --git a/apps/desktop/src/routes/(window-chrome)/settings/experimental.tsx b/apps/desktop/src/routes/(window-chrome)/settings/experimental.tsx
index aed79541b..fd7c12571 100644
--- a/apps/desktop/src/routes/(window-chrome)/settings/experimental.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/settings/experimental.tsx
@@ -25,6 +25,7 @@ function Inner(props: { initialStore: GeneralSettingsStore | null }) {
enableNativeCameraPreview: false,
enableNewRecordingFlow: false,
autoZoomOnClicks: false,
+ customCursorCapture2: true,
},
);
@@ -57,8 +58,10 @@ function Inner(props: { initialStore: GeneralSettingsStore | null }) {
<ToggleSetting
label="Custom cursor capture in Studio Mode"
description="Studio Mode recordings will capture cursor state separately for customisation (size, smoothing) in the editor. Currently experimental as cursor events may not be captured accurately."
- value={!!settings.customCursorCapture}
- onChange={(value) => handleChange("customCursorCapture", value)}
+ value={!!settings.customCursorCapture2}
+ onChange={(value) =>
+ handleChange("customCursorCapture2", value)
+ }
/>
<ToggleSetting
label="Native camera preview"
diff --git a/apps/desktop/src/routes/(window-chrome)/settings/general.tsx b/apps/desktop/src/routes/(window-chrome)/settings/general.tsx
index 67b42fd99..b3c691803 100644
--- a/apps/desktop/src/routes/(window-chrome)/settings/general.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/settings/general.tsx
@@ -117,6 +117,7 @@ function Inner(props: { initialStore: GeneralSettingsStore | null }) {
enableNativeCameraPreview: false,
enableNewRecordingFlow: false,
autoZoomOnClicks: false,
+ customCursorCapture2: true,
},
);
diff --git a/apps/desktop/src/routes/editor/ConfigSidebar.tsx b/apps/desktop/src/routes/editor/ConfigSidebar.tsx
index 3bc64d3fd..31dab706b 100644
--- a/apps/desktop/src/routes/editor/ConfigSidebar.tsx
+++ b/apps/desktop/src/routes/editor/ConfigSidebar.tsx
@@ -1992,7 +1992,7 @@ function ZoomSegmentConfig(props: {
<KTabs.Trigger
value="auto"
class="z-10 flex-1 py-2.5 text-gray-11 transition-colors duration-100 outline-none ui-selected:text-gray-12 peer"
- disabled={!generalSettings.data?.customCursorCapture}
+ disabled={!generalSettings.data?.customCursorCapture2}
>
Auto
</KTabs.Trigger>
diff --git a/apps/desktop/src/routes/editor/ExportDialog.tsx b/apps/desktop/src/routes/editor/ExportDialog.tsx
index c227e11e0..409be7c73 100644
--- a/apps/desktop/src/routes/editor/ExportDialog.tsx
+++ b/apps/desktop/src/routes/editor/ExportDialog.tsx
@@ -134,15 +134,25 @@ export function ExportDialog() {
const exportWithSettings = (onProgress: (progress: FramesRendered) => void) =>
exportVideo(
projectPath,
- {
- format: settings.format,
- fps: settings.fps,
- resolution_base: {
- x: settings.resolution.width,
- y: settings.resolution.height,
- },
- compression: settings.compression,
- } as (Mp4ExportSettings & GifExportSettings) & { format: "Mp4" | "Gif" },
+ settings.format === "Mp4"
+ ? {
+ format: "Mp4",
+ fps: settings.fps,
+ resolution_base: {
+ x: settings.resolution.width,
+ y: settings.resolution.height,
+ },
+ compression: settings.compression,
+ }
+ : {
+ format: "Gif",
+ fps: settings.fps,
+ resolution_base: {
+ x: settings.resolution.width,
+ y: settings.resolution.height,
+ },
+ quality: null,
+ },
onProgress,
);
diff --git a/apps/desktop/src/utils/tauri.ts b/apps/desktop/src/utils/tauri.ts
index 41170046f..cd7ad4705 100644
--- a/apps/desktop/src/utils/tauri.ts
+++ b/apps/desktop/src/utils/tauri.ts
@@ -548,7 +548,7 @@ export type GeneralSettingsStore = {
windowTransparency?: boolean;
postStudioRecordingBehaviour?: PostStudioRecordingBehaviour;
mainWindowRecordingStartBehaviour?: MainWindowRecordingStartBehaviour;
- customCursorCapture?: boolean;
+ customCursorCapture2?: boolean;
serverUrl?: string;
recordingCountdown?: number | null;
enableNativeCameraPreview: boolean;