feat(workspace): 桌面工作区、主题与交互更新,发布 0.1.2
Gitea CI / Check code and tests (push) Successful in 6m37s
Gitea CI / Build Windows x64 app (push) Successful in 3m18s
Gitea CI / Build Android APK (push) Successful in 3m47s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m7s
Gitea CI / Assemble and validate CI artifacts (push) Successful in 50s
Gitea CI / Gitea CI passed (push) Successful in 2s
Gitea Release / Prepare draft Release (push) Successful in 9s
Gitea Release / Upload Android to draft Release (push) Successful in 16s
Gitea Release / Upload Windows to draft Release (push) Successful in 22s
Gitea Release / Verify and publish Release (push) Successful in 14s
Gitea CI / Check code and tests (push) Successful in 6m37s
Gitea CI / Build Windows x64 app (push) Successful in 3m18s
Gitea CI / Build Android APK (push) Successful in 3m47s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m7s
Gitea CI / Assemble and validate CI artifacts (push) Successful in 50s
Gitea CI / Gitea CI passed (push) Successful in 2s
Gitea Release / Prepare draft Release (push) Successful in 9s
Gitea Release / Upload Android to draft Release (push) Successful in 16s
Gitea Release / Upload Windows to draft Release (push) Successful in 22s
Gitea Release / Verify and publish Release (push) Successful in 14s
This commit was merged in pull request #13.
This commit is contained in:
1 parent
aa5255d1e4
commit
abc1868550
260 files changed
+43964
-5591
No files matched your search
@@ -1,14 +1,17 @@
|
||||
import 'package:cutdex/l10n/l10n.dart';
|
||||
import 'package:cutdex_sdk/runtime/contracts.dart';
|
||||
import 'package:cutdex_sdk/timeline/model.dart';
|
||||
import 'package:cutdex_sdk/timeline/engine.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:cutdex_ui/theme.dart';
|
||||
import 'package:cutdex_ui/widgets.dart';
|
||||
|
||||
import '../../workspace/timeline_session.dart';
|
||||
import '../../shared/widgets/listenable_selector.dart';
|
||||
import 'canvas_presets.dart';
|
||||
import 'project_settings_dialog.dart';
|
||||
import 'project_property_row.dart';
|
||||
|
||||
/// Project information uses the live editing session, including unsaved edits.
|
||||
class ProjectProperties extends StatelessWidget {
|
||||
@@ -18,34 +21,41 @@ class ProjectProperties extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final sequence = session.activeSequenceId;
|
||||
final timeline = sequence == null
|
||||
? null
|
||||
: session.persistence.timeline(sequence);
|
||||
final duration = sequence == null
|
||||
? 0
|
||||
: session.sequenceDurationTicks(sequence);
|
||||
final frame = timeline?.format.frameDuration;
|
||||
final fps = frame == null ? null : frame.denominator / frame.numerator;
|
||||
final canvas = session.canvas;
|
||||
String number(double value) => value == value.roundToDouble()
|
||||
? value.toStringAsFixed(0)
|
||||
: value.toStringAsFixed(3).replaceFirst(RegExp(r'0+$'), '');
|
||||
TimelineKernel? timeline() {
|
||||
final sequence = session.activeSequenceId;
|
||||
return sequence == null ? null : session.persistence.timeline(sequence);
|
||||
}
|
||||
|
||||
Widget info(String label, String Function() value) =>
|
||||
_Info(label, session, value);
|
||||
|
||||
return WorkspacePanel(
|
||||
paintBackground: false,
|
||||
title: context.l10n.projectProperties,
|
||||
trailing: TextButton(
|
||||
key: const ValueKey('project-settings-edit'),
|
||||
onPressed: () => showAppDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => ProjectSettingsDialog(session: session),
|
||||
trailing: SizedBox(
|
||||
height: AppTheme.isDesktop(context) ? AppInspectorMetrics.input : null,
|
||||
child: TextButton(
|
||||
key: const ValueKey('project-settings-edit'),
|
||||
style: AppTheme.isDesktop(context)
|
||||
? AppTheme.toolbarButtonStyle(context)
|
||||
: null,
|
||||
onPressed: () => showAppDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => ProjectSettingsDialog(session: session),
|
||||
),
|
||||
child: Text(context.l10n.modify),
|
||||
),
|
||||
child: Text(context.l10n.modify),
|
||||
),
|
||||
headerHeight: AppControlSize.panelToolbar,
|
||||
headerPadding: const EdgeInsets.symmetric(
|
||||
horizontal: AppSpacing.panelContentHorizontal,
|
||||
headerHeight: AppTheme.isDesktop(context)
|
||||
? AppDesktopMetrics.panelHeader
|
||||
: AppControlSize.panelToolbar,
|
||||
headerPadding: EdgeInsets.symmetric(
|
||||
horizontal: AppTheme.isDesktop(context)
|
||||
? AppInspectorMetrics.padding
|
||||
: AppSpacing.panelContentHorizontal,
|
||||
),
|
||||
showHeaderDivider: false,
|
||||
child: ScrollEdgeFadeBuilder(
|
||||
@@ -55,32 +65,40 @@ class ProjectProperties extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
_Info(context.l10n.timelineName, session.document.name),
|
||||
_Info(
|
||||
context.l10n.canvasSize,
|
||||
'${number(canvas.width)} × ${number(canvas.height)} px',
|
||||
info(context.l10n.timelineName, () => session.document.name),
|
||||
info(context.l10n.canvasSize, () {
|
||||
final canvas = session.canvas;
|
||||
return '${number(canvas.width)} × ${number(canvas.height)} px';
|
||||
}),
|
||||
info(
|
||||
context.l10n.canvasRatio,
|
||||
() => session.canvas.label(context),
|
||||
),
|
||||
_Info(context.l10n.canvasRatio, canvas.label(context)),
|
||||
_Info(
|
||||
info(
|
||||
context.l10n.projectColorSpace,
|
||||
switch (session.projectColorSpace) {
|
||||
() => switch (session.projectColorSpace) {
|
||||
RenderColorSpace.rec2020HLG => 'HDR · Rec.2020 HLG',
|
||||
RenderColorSpace.rec2020PQ => 'HDR · Rec.2020 PQ',
|
||||
_ => 'SDR · Rec.709',
|
||||
},
|
||||
),
|
||||
_Info(
|
||||
info(
|
||||
context.l10n.currentSequence,
|
||||
timeline?.name ?? context.l10n.none,
|
||||
),
|
||||
_Info(
|
||||
context.l10n.frameRate,
|
||||
fps == null ? '—' : '${number(fps)} fps',
|
||||
),
|
||||
_Info(
|
||||
context.l10n.totalDuration,
|
||||
'${(duration / TimelineClock.ticksPerSecond).toStringAsFixed(2)} ${context.l10n.seconds}',
|
||||
() => timeline()?.name ?? context.l10n.none,
|
||||
),
|
||||
info(context.l10n.frameRate, () {
|
||||
final frame = timeline()?.format.frameDuration;
|
||||
return frame == null
|
||||
? '—'
|
||||
: '${number(frame.denominator / frame.numerator)} fps';
|
||||
}),
|
||||
info(context.l10n.totalDuration, () {
|
||||
final sequence = session.activeSequenceId;
|
||||
final duration = sequence == null
|
||||
? 0
|
||||
: session.sequenceDurationTicks(sequence);
|
||||
return '${(duration / TimelineClock.ticksPerSecond).toStringAsFixed(2)} ${context.l10n.seconds}';
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -90,27 +108,41 @@ class ProjectProperties extends StatelessWidget {
|
||||
}
|
||||
|
||||
class _Info extends StatelessWidget {
|
||||
const _Info(this.label, this.value);
|
||||
const _Info(this.label, this.session, this.select);
|
||||
|
||||
final String label;
|
||||
final String value;
|
||||
final EditorTimelineSession session;
|
||||
final String Function() select;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Padding(
|
||||
padding: AppSpacing.panelSection,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: AppSpacing.small,
|
||||
children: [
|
||||
Text(label, style: Theme.of(context).textTheme.bodySmall),
|
||||
Expanded(
|
||||
child: Text(
|
||||
value,
|
||||
textAlign: TextAlign.right,
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
Widget build(BuildContext context) {
|
||||
if (AppTheme.isDesktop(context)) {
|
||||
return ListenableSelector<String>(
|
||||
listenable: session,
|
||||
select: select,
|
||||
builder: (context, value) =>
|
||||
ProjectPropertyRow(label: label, value: value),
|
||||
);
|
||||
}
|
||||
final value = ListenableSelector<String>(
|
||||
listenable: session,
|
||||
select: select,
|
||||
builder: (context, value) => Text(
|
||||
value,
|
||||
textAlign: TextAlign.right,
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
);
|
||||
return Padding(
|
||||
padding: AppTheme.propertySectionPadding(context),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: AppSpacing.small,
|
||||
children: [
|
||||
Text(label, style: Theme.of(context).textTheme.bodySmall),
|
||||
Expanded(child: value),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user