feat(workspace): refresh desktop editing experience and prepare 0.1.2
Gitea CI / Build Android APK (pull_request) Canceled after 0s
Gitea CI / Build Windows x64 app (pull_request) Canceled after 0s
Gitea CI / Audit and package Windows x64 (pull_request) Canceled after 0s
Gitea CI / Assemble and validate CI artifacts (pull_request) Canceled after 0s
Gitea CI / Gitea CI passed (pull_request) Canceled after 0s
Gitea CI / Check code and tests (pull_request) Canceled after 6m29s

This commit is contained in:
lingjhf committed 2026-10-09 01:56:01 +08:00
1 parent aa5255d1e4
commit 2e0033ce2d
260 files changed
+43963 -5591

No files matched your search

@@ -1,3 +1,5 @@
import '../../shared/widgets/listenable_selector.dart';
import 'package:cutdex/shared/widgets/error_notification_host.dart';
import 'dart:math' as math;
@@ -89,87 +91,91 @@ class TimelineSpeedEditor extends StatelessWidget {
}
@override
Widget build(BuildContext context) => ListenableBuilder(
listenable: Listenable.merge([session, controller.contentChanges]),
builder: (context, _) => LayoutBuilder(
builder: (context, constraints) {
final frame = controller.project(
TimelineViewportRect(
width: constraints.maxWidth,
height: constraints.maxHeight,
),
);
final query = frame.version.kernelVersion.query();
final viewportBounds =
Offset.zero & Size(constraints.maxWidth, constraints.maxHeight);
final bars = <Widget>[];
void addHeader(
ElementHandle handle,
TimelineClipLayout clipLayout, {
bool ghost = false,
}) {
final record = query.element(handle);
if (!session.isCustomSpeedEnabled(sequence, record.id)) return;
final segments = session.clipSpeedSegments(record);
if (segments == null) return;
final layout = TimelineSpeedLayout(
clip: clipLayout,
segments: segments,
pixelsPerTick: controller.camera.pixelsPerTick,
Widget build(BuildContext context) => ListenableSelector<Object>(
listenable: session,
select: () => (session.version, session.acceptsEdits),
builder: (context, _) => ListenableBuilder(
listenable: controller.contentChanges,
builder: (context, _) => LayoutBuilder(
builder: (context, constraints) {
final frame = controller.project(
TimelineViewportRect(
width: constraints.maxWidth,
height: constraints.maxHeight,
),
);
final bounds = clipLayout.toViewport(layout.bounds);
if (bounds.isEmpty || !bounds.overlaps(viewportBounds)) {
return;
}
bars.add(
Positioned(
key: ValueKey((sequence, record.id)),
left: bounds.left,
top: bounds.top,
width: bounds.width,
height: bounds.height,
child: IgnorePointer(
ignoring: ghost,
child: _ClipSpeedEditor(
session: session,
sequence: sequence,
clip: record.id,
controller: controller,
layout: layout,
final query = frame.version.kernelVersion.query();
final viewportBounds =
Offset.zero & Size(constraints.maxWidth, constraints.maxHeight);
final bars = <Widget>[];
void addHeader(
ElementHandle handle,
TimelineClipLayout clipLayout, {
bool ghost = false,
}) {
final record = query.element(handle);
if (!session.isCustomSpeedEnabled(sequence, record.id)) return;
final segments = session.clipSpeedSegments(record);
if (segments == null) return;
final layout = TimelineSpeedLayout(
clip: clipLayout,
segments: segments,
pixelsPerTick: controller.camera.pixelsPerTick,
);
final bounds = clipLayout.toViewport(layout.bounds);
if (bounds.isEmpty || !bounds.overlaps(viewportBounds)) {
return;
}
bars.add(
Positioned(
key: ValueKey((sequence, record.id)),
left: bounds.left,
top: bounds.top,
width: bounds.width,
height: bounds.height,
child: IgnorePointer(
ignoring: ghost,
child: _ClipSpeedEditor(
session: session,
sequence: sequence,
clip: record.id,
controller: controller,
layout: layout,
),
),
),
),
);
}
for (var index = 0; index < frame.length; index++) {
if (frame.kindAt(index) == TimelineViewportItemKind.transition) {
continue;
);
}
final identity = frame.identityAt(index);
final handle = controller.elementForIdentity(identity);
if (handle == null) continue;
final bodyId = identity is LayoutBodyId
? identity
: LayoutBodyId.element(handle);
// The resident item is a landing reservation while the moving clip
// is painted separately at its pointer-following ghost coordinates.
if (controller.dragGhostFor(bodyId) != null) continue;
addHeader(handle, controller.clipLayoutAt(frame, index));
}
for (final ghost in controller.dragGhosts) {
final body = ghost.body;
addHeader(
body.id.owner,
controller.clipLayout(
controller.dragGhostBounds(ghost, frame.viewport),
owner: body.id.owner,
),
ghost: true,
);
}
return Stack(clipBehavior: Clip.none, children: bars);
},
for (var index = 0; index < frame.length; index++) {
if (frame.kindAt(index) == TimelineViewportItemKind.transition) {
continue;
}
final identity = frame.identityAt(index);
final handle = controller.elementForIdentity(identity);
if (handle == null) continue;
final bodyId = identity is LayoutBodyId
? identity
: LayoutBodyId.element(handle);
// The resident item is a landing reservation while the moving clip
// is painted separately at its pointer-following ghost coordinates.
if (controller.dragGhostFor(bodyId) != null) continue;
addHeader(handle, controller.clipLayoutAt(frame, index));
}
for (final ghost in controller.dragGhosts) {
final body = ghost.body;
addHeader(
body.id.owner,
controller.clipLayout(
controller.dragGhostBounds(ghost, frame.viewport),
owner: body.id.owner,
),
ghost: true,
);
}
return Stack(clipBehavior: Clip.none, children: bars);
},
),
),
);
}