Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Fix theme init, match Win11's exit caption buttons better

Ilyaa16029aefa07
diff --git a/apps/desktop/src/App.tsx b/apps/desktop/src/App.tsx
index 051f46042..fed8794d0 100644
--- a/apps/desktop/src/App.tsx
+++ b/apps/desktop/src/App.tsx
@@ -79,12 +79,17 @@ function Inner() {
function createThemeListener() {
const currentWindow = getCurrentWebviewWindow();
- const [theme, themeActions] = createResource<AppTheme>(() =>
- generalSettingsStore.get().then((s) => s?.theme ?? "system")
+ const [theme, themeActions] = createResource<AppTheme | null>(() =>
+ generalSettingsStore.get().then((s) => {
+ const t = s?.theme ?? null;
+ update(t);
+ return t
+ })
);
generalSettingsStore.listen((s) => {
- themeActions.mutate(s?.theme);
+ themeActions.mutate(s?.theme ?? null);
update(theme());
+ console.log(`updating: ${s?.theme}`);
});
let unlisten: UnlistenFn | undefined;
@@ -93,7 +98,8 @@ function createThemeListener() {
});
onCleanup(() => unlisten?.());
- function update(appTheme: AppTheme | undefined) {
+ function update(appTheme: AppTheme | null | undefined) {
+ console.log(`apptheme: ${appTheme}`);
if (appTheme === undefined) return;
if (
location.pathname === "/camera" ||
diff --git a/apps/desktop/src/components/titlebar/controls/CaptionControlsWindows11.tsx b/apps/desktop/src/components/titlebar/controls/CaptionControlsWindows11.tsx
index 55c1fc72c..20c970532 100644
--- a/apps/desktop/src/components/titlebar/controls/CaptionControlsWindows11.tsx
+++ b/apps/desktop/src/components/titlebar/controls/CaptionControlsWindows11.tsx
@@ -10,7 +10,7 @@ export default function (props: ComponentProps<"div">) {
return (
<div
- class={`h-full align-baseline cursor-default rounded-none select-none *:outline-none *:transition-all *:duration-150 ${local.class}`}
+ class={`h-full align-baseline cursor-default rounded-none select-none *:outline-none *:transition-all *:duration-200 ${local.class}`}
{...otherProps}
>
<ControlButton
@@ -51,7 +51,7 @@ export default function (props: ComponentProps<"div">) {
onClick={titlebarState.closable ? window.close : undefined}
disabled={!titlebarState.closable}
class={cx(
- "max-h-20 w-[46px] rounded-none bg-transparent text-black-transparent-80",
+ "max-h-20 w-[46px] rounded-none bg-transparent text-black-transparent-80 hover:text-gray-50",
"hover:bg-[#c42b1c] dark:hover:bg-[#c42b1c active:bg-[#c42b1c]/90 dark:active:bg-[#c42b1c]/90",
"disabled:hover:bg-transparent dark:disabled:hover:bg-transparent disabled:text-black-transparent-40",
)}
diff --git a/apps/desktop/src/routes/(window-chrome)/settings/general.tsx b/apps/desktop/src/routes/(window-chrome)/settings/general.tsx
index 0a58aabb7..e763d0439 100644
--- a/apps/desktop/src/routes/(window-chrome)/settings/general.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/settings/general.tsx
@@ -100,7 +100,7 @@ function AppearanceSection(props: {
<button
type="button"
aria-checked={props.currentTheme === theme.id}
- class="flex flex-col items-center group rounded-md focus:outline-none focus:ring-gray-300 focus:ring-offset-gray-50 focus:ring-offset-2 focus:ring-4"
+ class="flex flex-col items-center group rounded-md focus:outline-none focus-visible:ring-gray-300 focus-visible:ring-offset-gray-50 focus-visible:ring-offset-2 focus-visible:ring-4"
onClick={() => props.onThemeChange(theme.id)}
>
<div