Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

New theme preview icons

Ilyaef4a54ff01f7
diff --git a/apps/desktop/src/assets/theme-previews/auto.jpg b/apps/desktop/src/assets/theme-previews/auto.jpg
index 6ba498fcd..2a9304cb4 100644
Binary files a/apps/desktop/src/assets/theme-previews/auto.jpg and b/apps/desktop/src/assets/theme-previews/auto.jpg differ
diff --git a/apps/desktop/src/assets/theme-previews/dark.jpg b/apps/desktop/src/assets/theme-previews/dark.jpg
index 0f3916363..9820c9f57 100644
Binary files a/apps/desktop/src/assets/theme-previews/dark.jpg and b/apps/desktop/src/assets/theme-previews/dark.jpg differ
diff --git a/apps/desktop/src/assets/theme-previews/legacy-auto.jpg b/apps/desktop/src/assets/theme-previews/legacy-auto.jpg
new file mode 100644
index 000000000..54ee8d060
Binary files /dev/null and b/apps/desktop/src/assets/theme-previews/legacy-auto.jpg differ
diff --git a/apps/desktop/src/assets/theme-previews/legacy-dark.jpg b/apps/desktop/src/assets/theme-previews/legacy-dark.jpg
new file mode 100644
index 000000000..2fb280563
Binary files /dev/null and b/apps/desktop/src/assets/theme-previews/legacy-dark.jpg differ
diff --git a/apps/desktop/src/assets/theme-previews/legacy-light.jpg b/apps/desktop/src/assets/theme-previews/legacy-light.jpg
new file mode 100644
index 000000000..46fc04cf4
Binary files /dev/null and b/apps/desktop/src/assets/theme-previews/legacy-light.jpg differ
diff --git a/apps/desktop/src/assets/theme-previews/light.jpg b/apps/desktop/src/assets/theme-previews/light.jpg
index f52be40b1..64e83080e 100644
Binary files a/apps/desktop/src/assets/theme-previews/light.jpg and b/apps/desktop/src/assets/theme-previews/light.jpg differ
diff --git a/apps/desktop/src/routes/(window-chrome)/settings/general.tsx b/apps/desktop/src/routes/(window-chrome)/settings/general.tsx
index 08b484640..70e5c65a0 100644
--- a/apps/desktop/src/routes/(window-chrome)/settings/general.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/settings/general.tsx
@@ -20,6 +20,9 @@ import {
import { createStore, reconcile } from "solid-js/store";
import themePreviewAuto from "~/assets/theme-previews/auto.jpg";
import themePreviewDark from "~/assets/theme-previews/dark.jpg";
+import themePreviewLegacyAuto from "~/assets/theme-previews/legacy-auto.jpg";
+import themePreviewLegacyDark from "~/assets/theme-previews/legacy-dark.jpg";
+import themePreviewLegacyLight from "~/assets/theme-previews/legacy-light.jpg";
import themePreviewLight from "~/assets/theme-previews/light.jpg";
import { Input } from "~/routes/editor/ui";
import { authStore, generalSettingsStore } from "~/store";
@@ -111,14 +114,45 @@ export default function GeneralSettings() {
function AppearanceSection(props: {
currentTheme: AppTheme;
+ newRecordingFlow: boolean;
onThemeChange: (theme: AppTheme) => void;
}) {
const options = [
- { id: "system", name: "System", preview: themePreviewAuto },
- { id: "light", name: "Light", preview: themePreviewLight },
- { id: "dark", name: "Dark", preview: themePreviewDark },
+ {
+ id: "system",
+ name: "System",
+ preview: props.newRecordingFlow
+ ? themePreviewAuto
+ : themePreviewLegacyAuto,
+ },
+ {
+ id: "light",
+ name: "Light",
+ preview: props.newRecordingFlow
+ ? themePreviewLight
+ : themePreviewLegacyLight,
+ },
+ {
+ id: "dark",
+ name: "Dark",
+ preview: props.newRecordingFlow
+ ? themePreviewDark
+ : themePreviewLegacyDark,
+ },
] satisfies { id: AppTheme; name: string; preview: string }[];
+ const previews = createMemo(() => {
+ return {
+ system: props.newRecordingFlow
+ ? themePreviewAuto
+ : themePreviewLegacyAuto,
+ light: props.newRecordingFlow
+ ? themePreviewLight
+ : themePreviewLegacyLight,
+ dark: props.newRecordingFlow ? themePreviewDark : themePreviewLegacyDark,
+ };
+ });
+
return (
<div class="flex flex-col gap-4">
<div class="flex flex-col pb-4 border-b border-gray-2">
@@ -155,11 +189,16 @@ function AppearanceSection(props: {
aria-label={`Select theme: ${theme.name}`}
>
<div class="flex justify-center items-center w-full h-full">
- <img
- draggable={false}
- src={theme.preview}
- alt={`Preview of ${theme.name} theme`}
- />
+ <Show when={previews()[theme.id]} keyed>
+ {(preview) => (
+ <img
+ class="animate-in fade-in duration-300"
+ draggable={false}
+ src={preview}
+ alt={`Preview of ${theme.name} theme`}
+ />
+ )}
+ </Show>
</div>
</div>
<span
@@ -376,6 +415,7 @@ function Inner(props: { initialStore: GeneralSettingsStore | null }) {
<div class="p-4 space-y-6">
<AppearanceSection
currentTheme={settings.theme ?? "system"}
+ newRecordingFlow={settings.enableNewRecordingFlow}
onThemeChange={(newTheme) => {
setSettings("theme", newTheme);
generalSettingsStore.set({ theme: newTheme });