Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

make whole drag region work

Ilyaba27b8d81521
diff --git a/apps/desktop/src-tauri/src/windows.rs b/apps/desktop/src-tauri/src/windows.rs
index 1237b238b..8ba6504a3 100644
--- a/apps/desktop/src-tauri/src/windows.rs
+++ b/apps/desktop/src-tauri/src/windows.rs
@@ -168,6 +168,7 @@ impl ShowCapWindow {
.build()?,
Self::Editor { project_id } => self
.window_builder(app, format!("/editor?id={project_id}"))
+ .inner_size(1150.0, 800.0)
.maximizable(true)
.center()
.build()?,
diff --git a/apps/desktop/src/components/titlebar/Titlebar.tsx b/apps/desktop/src/components/titlebar/Titlebar.tsx
index 16019842c..e26e1a8ab 100644
--- a/apps/desktop/src/components/titlebar/Titlebar.tsx
+++ b/apps/desktop/src/components/titlebar/Titlebar.tsx
@@ -14,7 +14,7 @@ export default function Titlebar() {
return (
<header
class={cx(
- "flex flex-row items-center z-50 select-none space-x-1 shrink-0 border-gray-200",
+ "flex flex-row items-center select-none space-x-1 shrink-0 border-gray-200",
titlebarState.transparent ? "" : "bg-gray-50",
titlebarState.border ? "border-b" : ""
)}
diff --git a/apps/desktop/src/components/titlebar/controls/CaptionControlsWindows11.tsx b/apps/desktop/src/components/titlebar/controls/CaptionControlsWindows11.tsx
index bff87474c..e4d1684c1 100644
--- a/apps/desktop/src/components/titlebar/controls/CaptionControlsWindows11.tsx
+++ b/apps/desktop/src/components/titlebar/controls/CaptionControlsWindows11.tsx
@@ -23,7 +23,7 @@ export default function (props: ComponentProps<"div">) {
focused() ? "*:text-black-transparent-80" : "*:text-black-transparent-40"
)}
style={{
- "font-family": "Segoe Fluent Icons', 'Segoe MDL2 Assets"
+ "z-index": 99999999,
}}
{...otherProps}
>
diff --git a/apps/desktop/src/routes/(window-chrome).tsx b/apps/desktop/src/routes/(window-chrome).tsx
index cb3ecd85e..bbd1dfebc 100644
--- a/apps/desktop/src/routes/(window-chrome).tsx
+++ b/apps/desktop/src/routes/(window-chrome).tsx
@@ -3,7 +3,7 @@ import { onCleanup, onMount, ParentProps, Suspense } from "solid-js";
import { getCurrentWindow } from "@tauri-apps/api/window";
import { UnlistenFn } from "@tauri-apps/api/event";
import { AbsoluteInsetLoader } from "~/components/Loader";
-import { initializeTitlebar } from "~/utils/titlebar-state";
+import titlebarState, { initializeTitlebar } from "~/utils/titlebar-state";
import Titlebar from "~/components/titlebar/Titlebar";
export const route = {
@@ -52,7 +52,7 @@ function Inner(props: ParentProps) {
});
return (
- <div class="animate-in fade-in flex-1 flex flex-col overflow-y-hidden">
+ <div class={`animate-in fade-in flex-1 flex flex-col overflow-y-hidden`}>
{props.children}
</div>
);
diff --git a/apps/desktop/src/routes/editor/Header.tsx b/apps/desktop/src/routes/editor/Header.tsx
index 8c5c116cf..8d34f7312 100644
--- a/apps/desktop/src/routes/editor/Header.tsx
+++ b/apps/desktop/src/routes/editor/Header.tsx
@@ -4,6 +4,7 @@ import {
Match,
Show,
Switch,
+ batch,
createEffect,
createResource,
onCleanup,
@@ -59,24 +60,27 @@ export function Header() {
currentWindow.setProgressBar({ progress: Math.round(percentage) });
});
- setTitlebar("border", false);
- setTitlebar("height", "4rem");
- setTitlebar(
- "items",
- <div
- data-tauri-drag-region
- class={cx(
- "flex flex-row justify-between items-center w-full cursor-default pr-5",
- ostype() === "windows" ? "pl-[4.3rem]" : "pl-[1.25rem]"
- )}
- >
- <div class="flex flex-row items-center gap-[0.5rem] text-[0.875rem]"></div>
- <div class="flex flex-row gap-2 font-medium items-center">
- <ShareButton />
- <ExportButton />
+ batch(() => {
+ setTitlebar("border", false);
+ setTitlebar("height", "4rem");
+ setTitlebar("transparent", true);
+ setTitlebar(
+ "items",
+ <div
+ data-tauri-drag-region
+ class={cx(
+ "flex flex-row justify-between items-center w-full cursor-default pr-5",
+ ostype() === "windows" ? "pl-[4.3rem]" : "pl-[1.25rem]"
+ )}
+ >
+ <div class="flex flex-row items-center gap-[0.5rem] text-[0.875rem]"></div>
+ <div class="flex flex-row gap-2 font-medium items-center">
+ <ShareButton />
+ <ExportButton />
+ </div>
</div>
- </div>
- );
+ );
+ });
return (
<>
diff --git a/apps/desktop/src/routes/in-progress-recording.tsx b/apps/desktop/src/routes/in-progress-recording.tsx
index 6e2ed720d..3e2475693 100644
--- a/apps/desktop/src/routes/in-progress-recording.tsx
+++ b/apps/desktop/src/routes/in-progress-recording.tsx
@@ -169,10 +169,10 @@ export default function () {
</div>
</div>
<div
- class="non-styled-move cursor-move flex items-center justify-center p-[0.25rem] border-l border-gray-400 dark:border-gray-200 hover:cursor-move"
+ class="bg-transparent non-styled-move cursor-move flex items-center justify-center p-[0.25rem] border-l border-gray-400 dark:border-gray-200 hover:cursor-move"
data-tauri-drag-region
>
- <IconCapMoreVertical data-tauri-drag-region class="text-gray-400 dark:text-gray-400" />
+ <IconCapMoreVertical class="pointer-events-none text-gray-400 dark:text-gray-400" />
</div>
</div>
);