Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Update preview icons

Ilya98ca06f404d8
diff --git a/apps/desktop/src/assets/theme-previews/auto.jpg b/apps/desktop/src/assets/theme-previews/auto.jpg
index af7b375fe..d261c6be6 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 2805bf202..0f3916363 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/light.jpg b/apps/desktop/src/assets/theme-previews/light.jpg
index cebb7ef2f..f52be40b1 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 e04182476..bd27acf22 100644
--- a/apps/desktop/src/routes/(window-chrome)/settings/general.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/settings/general.tsx
@@ -1,4 +1,4 @@
-import { createResource, Show, For } from "solid-js";
+import { createResource, Show, For, createSignal } from "solid-js";
import { createStore } from "solid-js/store";
import { generalSettingsStore } from "~/store";
import { commands, type GeneralSettingsStore } from "~/utils/tauri";
@@ -82,19 +82,17 @@ export default function GeneralSettings() {
);
}
-function ThemeSection() {
+function AppearanceSection() {
const themes = [
{ id: "auto", name: "System", preview: themePreviewAuto },
{ id: "light", name: "Light", preview: themePreviewLight },
{ id: "dark", name: "Dark", preview: themePreviewDark },
];
- const activeTheme = "auto";
+ const [currentTheme, setCurrentTheme] = createSignal(themes[0]);
return (
<div class="flex flex-col gap-4">
- <div class="flex items-center">
- <p class="text-[--text-primary] font-semibold">Appearance</p>
- </div>
+ <p class="text-[--text-primary] font-semibold">Appearance</p>
<div
class="flex justify-start items-center text-[--text-primary]"
on:contextmenu={(e) => e.preventDefault()}
@@ -102,14 +100,17 @@ function ThemeSection() {
<div class="flex justify-between px-1 w-[22.8rem]">
<For each={themes}>
{(theme) => (
- <button type="button" class="flex flex-col items-center">
+ <button
+ type="button"
+ class="flex flex-col items-center"
+ onClick={() => setCurrentTheme(theme)}
+ >
<div
class={`w-24 h-[4.8rem] rounded-md overflow-hidden focus:outline-none transition-all duration-200 ${
- activeTheme === theme.id
+ currentTheme().id === theme.id
? "ring-4 ring-blue-100 ring-opacity-50 ring-offset-2"
: "hover:ring-2 hover:ring-gray-300"
}`}
- // onClick={() => setActiveTheme(theme.id)}
aria-label={`Select theme: ${theme.name}`}
>
<div class="w-full h-full bg-gray-200 flex items-center justify-center">
@@ -121,7 +122,9 @@ function ThemeSection() {
</div>
<span
class={`mt-2 text-sm ${
- activeTheme !== theme.id ? "!text-opacity-10" : ""
+ currentTheme().id === theme.id
+ ? "font-medium"
+ : "font-light"
}`}
>
{theme.name}
@@ -188,7 +191,7 @@ function Inner(props: { initialStore: GeneralSettingsStore | null }) {
<div class="flex flex-col w-full h-full">
<div class="flex-1 overflow-y-auto">
<div class="p-4 space-y-2 divide-y divide-gray-200">
- <ThemeSection />
+ <AppearanceSection />
<For each={settingsList}>
{(setting) => (
<Show
diff --git a/apps/desktop/src/utils/tauri.ts b/apps/desktop/src/utils/tauri.ts
index 345a38c38..313c39469 100644
--- a/apps/desktop/src/utils/tauri.ts
+++ b/apps/desktop/src/utils/tauri.ts
@@ -157,6 +157,9 @@ async showWindow(window: ShowCapWindow) : Promise<void> {
},
async setWindowTheme(dark: boolean) : Promise<void> {
await TAURI_INVOKE("set_window_theme", { dark });
+},
+async writeClipboardString(text: string) : Promise<null> {
+ return await TAURI_INVOKE("write_clipboard_string", { text });
}
}
@@ -214,7 +217,7 @@ export type Audio = { duration: number; sample_rate: number; channels: number }
export type AudioConfiguration = { mute: boolean; improve: boolean }
export type AudioInputLevelChange = number
export type AudioMeta = { path: string }
-export type AuthStore = { token: string; user_id: string; expires: number; plan: Plan | null }
+export type AuthStore = { token: string; user_id: string | null; expires: number; plan: Plan | null }
export type AuthenticationInvalid = null
export type BackgroundConfiguration = { source: BackgroundSource; blur: number; padding: number; rounding: number; inset: number; crop: Crop | null }
export type BackgroundSource = { type: "wallpaper"; id: number } | { type: "image"; path: string | null } | { type: "color"; value: [number, number, number] } | { type: "gradient"; from: [number, number, number]; to: [number, number, number]; angle?: number }