Skip to content

Commit e2a9679

Browse files
committed
remove screenshots + improve timeline
1 parent 69105e6 commit e2a9679

File tree

13 files changed

+43
-49
lines changed

13 files changed

+43
-49
lines changed

apps/desktop/src-tauri/src/hotkeys.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub enum HotkeyAction {
4848
StartRecording,
4949
StopRecording,
5050
RestartRecording,
51-
TakeScreenshot,
51+
// TakeScreenshot,
5252
}
5353

5454
#[derive(Serialize, Deserialize, Type, Default)]
@@ -89,10 +89,9 @@ pub fn init(app: &AppHandle) {
8989
}
9090
HotkeyAction::RestartRecording => {
9191
let _ = RequestRestartRecording.emit(app);
92-
}
93-
HotkeyAction::TakeScreenshot => {
94-
let _ = RequestNewScreenshot.emit(app);
95-
}
92+
} // HotkeyAction::TakeScreenshot => {
93+
// let _ = RequestNewScreenshot.emit(app);
94+
// }
9695
}
9796
}
9897
}

apps/desktop/src-tauri/src/tray.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ pub fn create_tray(app: &AppHandle) -> tauri::Result<()> {
7777
true,
7878
None::<&str>,
7979
)?,
80-
&MenuItem::with_id(
81-
app,
82-
TrayItem::TakeScreenshot,
83-
"Take Screenshot",
84-
true,
85-
None::<&str>,
86-
)?,
80+
// &MenuItem::with_id(
81+
// app,
82+
// TrayItem::TakeScreenshot,
83+
// "Take Screenshot",
84+
// true,
85+
// None::<&str>,
86+
// )?,
8787
&MenuItem::with_id(
8888
app,
8989
TrayItem::PreviousRecordings,

apps/desktop/src/routes/(window-chrome)/settings/hotkeys.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const ACTION_TEXT: Record<HotkeyAction, string> = {
2424
startRecording: "Start Recording",
2525
stopRecording: "Stop Recording",
2626
restartRecording: "Restart Recording",
27-
takeScreenshot: "Take Screenshot",
27+
// takeScreenshot: "Take Screenshot",
2828
};
2929

3030
export default function () {
@@ -80,7 +80,7 @@ function Inner(props: { initialStore: HotkeysStore | null }) {
8080
"startRecording",
8181
"stopRecording",
8282
"restartRecording",
83-
"takeScreenshot",
83+
// "takeScreenshot",
8484
] as Array<HotkeyAction>
8585
}
8686
>

apps/desktop/src/routes/editor/ConfigSidebar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,8 @@ export function ConfigSidebar() {
442442
<div
443443
class={cx(
444444
"flex justify-center relative border-transparent border z-10 items-center rounded-md size-9 transition will-change-transform",
445-
selectedTab() !== item.id && "group-hover:border-gray-300"
445+
selectedTab() !== item.id &&
446+
"group-hover:border-gray-300 group-disabled:border-none"
446447
)}
447448
>
448449
<Dynamic component={item.icon} />

apps/desktop/src/routes/editor/Editor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function Inner() {
121121
<>
122122
<Header />
123123
<div
124-
class="flex overflow-y-hidden flex-col flex-1 gap-2 pb-2 w-full leading-5 animate-in fade-in"
124+
class="flex overflow-y-hidden flex-col flex-1 gap-2 pb-4 w-full leading-5 animate-in fade-in"
125125
data-tauri-drag-region
126126
>
127127
<div class="flex overflow-hidden flex-col flex-1">

apps/desktop/src/routes/editor/Timeline/ClipTrack.tsx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ export function ClipTrack(props: Pick<ComponentProps<"div">, "ref">) {
4848
<SegmentRoot
4949
class={cx(
5050
"overflow-hidden border border-transparent transition-colors duration-300 group",
51-
"hover:border-gray-500"
51+
"hover:border-gray-500",
52+
"bg-gradient-to-r timeline-gradient-border from-[#2675DB] via-[#4FA0FF] to-[#2675DB] shadow-[inset_0_5px_10px_5px_rgba(255,255,255,0.2)]"
5253
)}
5354
innerClass="ring-blue-300"
5455
segment={{
@@ -85,10 +86,7 @@ export function ClipTrack(props: Pick<ComponentProps<"div">, "ref">) {
8586

8687
<SegmentHandle
8788
position="start"
88-
class={cx(
89-
"absolute inset-y-0 z-10 opacity-0",
90-
"group-hover:opacity-100"
91-
)}
89+
class="opacity-0 group-hover:opacity-100"
9290
onMouseDown={(downEvent) => {
9391
const start = segment.start;
9492

@@ -147,7 +145,7 @@ export function ClipTrack(props: Pick<ComponentProps<"div">, "ref">) {
147145
});
148146
}}
149147
/>
150-
<SegmentContent class="justify-center items-center relative dark:text-black-transparent-60 text-white-transparent-60 bg-gradient-to-r timeline-gradient-border from-[#2675DB] via-[#4FA0FF] to-[#2675DB] shadow-[inset_0_5px_10px_5px_rgba(255,255,255,0.2)]">
148+
<SegmentContent class="justify-center items-center relative dark:text-black-transparent-60 text-white-transparent-60">
151149
<Show when={segment.start > 0}>
152150
<span class="text-black-transparent-60 text-[0.625rem] absolute top-[18px] left-5">
153151
{formatTime(segment.start)}
@@ -177,10 +175,7 @@ export function ClipTrack(props: Pick<ComponentProps<"div">, "ref">) {
177175
</SegmentContent>
178176
<SegmentHandle
179177
position="end"
180-
class={cx(
181-
"absolute inset-y-0 z-10 opacity-0",
182-
"group-hover:opacity-100"
183-
)}
178+
class="opacity-0 group-hover:opacity-100"
184179
onMouseDown={(downEvent) => {
185180
const end = segment.end;
186181

apps/desktop/src/routes/editor/Timeline/Track.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,20 @@ export function SegmentHandle(
106106
props: ComponentProps<"div"> & { position: "start" | "end" }
107107
) {
108108
const ctx = useSegmentContext();
109+
const hidden = () => ctx.width() < 80;
110+
109111
return (
110112
<div
111113
{...props}
112114
class={cx(
113-
"w-3 cursor-col-resize shrink-0 data-[hidden='true']:opacity-0 transition-opacity h-full flex flex-row items-center",
115+
"w-3 cursor-col-resize shrink-0 transition-opacity h-full flex flex-row items-center",
114116
props.position === "start"
115117
? "left-0 justify-end"
116118
: "right-0 justify-start",
119+
hidden() ? "opacity-0" : "opacity-0 group-hover:opacity-100",
117120
props.class
118121
)}
119-
data-hidden={ctx.width() < 50}
122+
data-hidden={hidden()}
120123
>
121124
<div class="w-[3px] h-8 bg-solid-white rounded-full" />
122125
</div>

apps/desktop/src/routes/editor/Timeline/ZoomTrack.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ export function ZoomTrack(props: {
226226
>
227227
<SegmentHandle
228228
position="start"
229-
class="absolute opacity-0 group-hover:opacity-100"
230229
onMouseDown={createMouseDownDrag(
231230
() => {
232231
const start = segment.start;
@@ -264,7 +263,7 @@ export function ZoomTrack(props: {
264263
)}
265264
/>
266265
<SegmentContent
267-
class="flex justify-center items-center cursor-pointer"
266+
class="flex justify-center items-center cursor-grab"
268267
onMouseDown={createMouseDownDrag(
269268
() => {
270269
const original = { ...segment };
@@ -307,7 +306,7 @@ export function ZoomTrack(props: {
307306

308307
return (
309308
<Show when={ctx.width() > 100}>
310-
<div class="flex flex-col gap-1 justify-center items-center text-xs text-gray-50 whitespace-nowrap dark:text-gray-500">
309+
<div class="flex flex-col gap-1 justify-center items-center text-xs text-gray-50 whitespace-nowrap dark:text-gray-500 animate-in fade-in">
311310
<span class="opacity-70">Zoom</span>
312311
<div class="flex gap-1 items-center text-md">
313312
<IconLucideSearch class="size-3.5" />{" "}
@@ -320,7 +319,6 @@ export function ZoomTrack(props: {
320319
</SegmentContent>
321320
<SegmentHandle
322321
position="end"
323-
class="absolute opacity-0 group-hover:opacity-100"
324322
onMouseDown={createMouseDownDrag(
325323
() => {
326324
const end = segment.end;

apps/desktop/src/routes/editor/Timeline/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { ZoomSegmentDragState, ZoomTrack } from "./ZoomTrack";
1111
import { ClipTrack } from "./ClipTrack";
1212
import { useEditorContext } from "../context";
1313

14-
const TIMELINE_PADDING = 8;
14+
const TIMELINE_PADDING = 16;
1515

1616
export function Timeline() {
1717
const {
@@ -240,15 +240,15 @@ function TimelineMarkings() {
240240
return Array.from(
241241
{ length: 2 + (state.timelineTransform.zoom + 5) / markingResolution() },
242242
(_, i) =>
243-
state.timelineTransform.position - diff + i * markingResolution()
243+
state.timelineTransform.position - diff + (i + 0) * markingResolution()
244244
);
245245
};
246246

247247
return (
248248
<div class="relative mb-1 h-4 text-xs">
249249
<For each={timelineMarkings()}>
250250
{(second) => (
251-
<>
251+
<Show when={second > 0}>
252252
<div
253253
class="absolute bottom-1 left-0 text-center rounded-full w-1 h-1 bg-[--text-tertiary] text-[--text-tertiary]"
254254
style={{
@@ -264,7 +264,7 @@ function TimelineMarkings() {
264264
</div>
265265
</Show>
266266
</div>
267-
</>
267+
</Show>
268268
)}
269269
</For>
270270
</div>

apps/desktop/src/utils/tauri.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ openEditorAfterRecording?: boolean }
269269
export type HapticPattern = "Alignment" | "LevelChange" | "Generic"
270270
export type HapticPerformanceTime = "Default" | "Now" | "DrawCompleted"
271271
export type Hotkey = { code: string; meta: boolean; ctrl: boolean; alt: boolean; shift: boolean }
272-
export type HotkeyAction = "startRecording" | "stopRecording" | "restartRecording" | "takeScreenshot"
272+
export type HotkeyAction = "startRecording" | "stopRecording" | "restartRecording"
273273
export type HotkeysConfiguration = { show: boolean }
274274
export type HotkeysStore = { hotkeys: { [key in HotkeyAction]: Hotkey } }
275275
export type InstantRecordingMeta = { fps: number; sample_rate: number | null }

0 commit comments

Comments
 (0)