Move editor UI into the app and release verified Core dependencies (#14)
Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m47s
Gitea CI / Check code and tests (push) Successful in 7m15s
Gitea CI / Build Android APK (push) Successful in 4m6s
Gitea CI / Build Windows x64 app (push) Successful in 3m34s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m29s
Gitea CI / Gitea CI passed (push) Successful in 1s
Gitea Release / Prepare draft Release (push) Failing after 8s
Gitea Release / Upload Android to draft Release (push) Skipped
Gitea Release / Upload Windows to draft Release (push) Skipped
Gitea Release / Verify and publish Release (push) Skipped
Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m47s
Gitea CI / Check code and tests (push) Successful in 7m15s
Gitea CI / Build Android APK (push) Successful in 4m6s
Gitea CI / Build Windows x64 app (push) Successful in 3m34s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m29s
Gitea CI / Gitea CI passed (push) Successful in 1s
Gitea Release / Prepare draft Release (push) Failing after 8s
Gitea Release / Upload Android to draft Release (push) Skipped
Gitea Release / Upload Windows to draft Release (push) Skipped
Gitea Release / Verify and publish Release (push) Skipped
This commit was merged in pull request #14.
This commit is contained in:
1 parent
abc1868550
commit
06f1c26681
452 files changed
+43806
-2329
No files matched your search
@@ -80,7 +80,6 @@ class _EditorWorkspaceState extends ConsumerState<EditorWorkspace> {
|
||||
ProjectViewSettings get _viewController =>
|
||||
ref.read(projectViewSettingsProvider(widget.projectId).notifier);
|
||||
bool get _propertiesOpen => _viewSettings.propertiesOpen;
|
||||
double? get _timelineHeight => _viewSettings.timelineHeight;
|
||||
|
||||
void _saveViewSettings() {
|
||||
if (widget.projectId.isEmpty ||
|
||||
@@ -93,7 +92,8 @@ class _EditorWorkspaceState extends ConsumerState<EditorWorkspace> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final viewSettings = ref.watch(
|
||||
projectViewSettingsProvider(widget.projectId),
|
||||
projectViewSettingsProvider(widget.projectId)
|
||||
.select((value) => (value.hasValue, value.value?.propertiesOpen)),
|
||||
);
|
||||
final preview = KeyedSubtree(
|
||||
key: _previewKey,
|
||||
@@ -205,10 +205,15 @@ class _EditorWorkspaceState extends ConsumerState<EditorWorkspace> {
|
||||
if (desktop) mediaButton,
|
||||
Expanded(
|
||||
child: desktop
|
||||
? _PreviewHeaderTitle(
|
||||
projectId: widget.projectId,
|
||||
timelineId: widget.timelineId,
|
||||
pending: _timelinePending,
|
||||
? Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: AppSpacing.small,
|
||||
),
|
||||
child: _PreviewHeaderTitle(
|
||||
projectId: widget.projectId,
|
||||
timelineId: widget.timelineId,
|
||||
pending: _timelinePending,
|
||||
),
|
||||
)
|
||||
: widget.showProjectName
|
||||
? Row(
|
||||
@@ -249,7 +254,7 @@ class _EditorWorkspaceState extends ConsumerState<EditorWorkspace> {
|
||||
? context.l10n.collapseProperties
|
||||
: context.l10n.expandProperties,
|
||||
isSelected: propertiesOpen,
|
||||
onPressed: !viewSettings.hasValue
|
||||
onPressed: !viewSettings.$1
|
||||
? null
|
||||
: () {
|
||||
if (desktop) {
|
||||
@@ -285,23 +290,40 @@ class _EditorWorkspaceState extends ConsumerState<EditorWorkspace> {
|
||||
),
|
||||
),
|
||||
);
|
||||
Widget dockedEditing({required bool showTools}) =>
|
||||
ExpandedEditorLayout(
|
||||
Widget dockedEditing({required bool showTools}) => Consumer(
|
||||
builder: (context, ref, _) {
|
||||
final dimensions = ref.watch(
|
||||
projectViewSettingsProvider(widget.projectId).select(
|
||||
(value) =>
|
||||
(value.value?.mediaWidth, value.value?.timelineHeight),
|
||||
),
|
||||
);
|
||||
return ExpandedEditorLayout(
|
||||
preview: preview,
|
||||
header: header,
|
||||
properties: properties,
|
||||
media: media,
|
||||
showMedia: dockMedia,
|
||||
showProperties: showTools && dockProperties,
|
||||
timelineHeight: _timelineHeight,
|
||||
mediaWidth: dimensions.$1,
|
||||
onMediaWidthChanged: (width) {
|
||||
if (viewSettings.$1) {
|
||||
_viewController.setMediaWidth(width);
|
||||
}
|
||||
},
|
||||
onMediaWidthChangeEnd: _saveViewSettings,
|
||||
timelineHeight: dimensions.$2,
|
||||
onTimelineHeightChanged: (height) {
|
||||
if (viewSettings.hasValue) {
|
||||
if (viewSettings.$1) {
|
||||
_viewController.setTimelineHeight(height);
|
||||
}
|
||||
},
|
||||
onTimelineHeightChangeEnd: _saveViewSettings,
|
||||
onJunctionResizeEnd: _saveViewSettings,
|
||||
timeline: timeline,
|
||||
);
|
||||
},
|
||||
);
|
||||
return Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
|
||||
@@ -32,7 +32,7 @@ class EditorTimelineDefaults extends StatelessWidget {
|
||||
: 26,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: AppTheme.isDesktop(context) ? AppSpacing.tiny : 0,
|
||||
horizontal: AppTheme.isDesktop(context) ? AppSpacing.small : 0,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
@@ -90,7 +90,9 @@ class EditorTimelineDefaults extends StatelessWidget {
|
||||
),
|
||||
)
|
||||
: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: AppSpacing.medium,
|
||||
),
|
||||
child: AppCommandToolbar(
|
||||
groups: [
|
||||
[
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../integrations/platform/device_experience.dart';
|
||||
import '../../../l10n/l10n.dart';
|
||||
import '../../../shared/layout/workspace_layout_metrics.dart';
|
||||
|
||||
import 'package:cutdex_ui/icons.dart';
|
||||
import 'package:cutdex_ui/theme.dart';
|
||||
@@ -61,6 +62,11 @@ class BoundedEditorLayout extends StatelessWidget {
|
||||
: context.l10n.expandProperties,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: desktop && tool == EditorTool.properties
|
||||
? AppTheme.propertiesPanelTheme(Theme.of(context))
|
||||
.textTheme
|
||||
.titleSmall
|
||||
: null,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -103,7 +109,12 @@ class BoundedEditorLayout extends StatelessWidget {
|
||||
right: 0,
|
||||
width: page
|
||||
? constraints.maxWidth
|
||||
: math.min(320, constraints.maxWidth),
|
||||
: math.min(
|
||||
desktop && tool == EditorTool.properties
|
||||
? WorkspaceLayoutMetrics.propertiesPanelWidth
|
||||
: 320,
|
||||
constraints.maxWidth,
|
||||
),
|
||||
child: Material(
|
||||
key: const Key('editor-tool-surface'),
|
||||
elevation: page ? 0 : 8,
|
||||
|
||||
@@ -15,9 +15,13 @@ class ExpandedEditorLayout extends StatefulWidget {
|
||||
required this.media,
|
||||
required this.showMedia,
|
||||
required this.showProperties,
|
||||
required this.mediaWidth,
|
||||
required this.onMediaWidthChanged,
|
||||
required this.onMediaWidthChangeEnd,
|
||||
required this.timelineHeight,
|
||||
required this.onTimelineHeightChanged,
|
||||
required this.onTimelineHeightChangeEnd,
|
||||
required this.onJunctionResizeEnd,
|
||||
required this.timeline,
|
||||
});
|
||||
|
||||
@@ -27,9 +31,13 @@ class ExpandedEditorLayout extends StatefulWidget {
|
||||
final Widget media;
|
||||
final bool showMedia;
|
||||
final bool showProperties;
|
||||
final double? mediaWidth;
|
||||
final ValueChanged<double> onMediaWidthChanged;
|
||||
final VoidCallback onMediaWidthChangeEnd;
|
||||
final double? timelineHeight;
|
||||
final ValueChanged<double> onTimelineHeightChanged;
|
||||
final VoidCallback onTimelineHeightChangeEnd;
|
||||
final VoidCallback onJunctionResizeEnd;
|
||||
final Widget timeline;
|
||||
|
||||
@override
|
||||
@@ -50,28 +58,35 @@ class _ExpandedEditorLayoutState extends State<ExpandedEditorLayout> {
|
||||
WorkspaceCard(key: Key('editor-$name-card'), child: child);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => LayoutBuilder(
|
||||
Widget build(BuildContext context) =>
|
||||
WorkspaceResizeHighlightScope(child: _layout());
|
||||
|
||||
Widget _layout() => LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final maximum = math.max(
|
||||
0.0,
|
||||
constraints.maxHeight -
|
||||
gap -
|
||||
WorkspaceLayoutMetrics.previewMinimumHeight,
|
||||
);
|
||||
final minimum = math.min(
|
||||
WorkspaceLayoutMetrics.timelineMinimumHeight,
|
||||
maximum,
|
||||
);
|
||||
final timelineHeight =
|
||||
(widget.timelineHeight ??
|
||||
constraints.maxHeight *
|
||||
WorkspaceLayoutMetrics.timelineDefaultHeightFraction)
|
||||
.clamp(minimum, maximum)
|
||||
.toDouble();
|
||||
const mediaWidth = WorkspaceLayoutMetrics.mediaPanelWidth;
|
||||
double resolveTimelineHeight(double? height) =>
|
||||
WorkspaceLayoutMetrics.resolveTimelineHeight(
|
||||
constraints.maxHeight,
|
||||
height,
|
||||
);
|
||||
final timelineHeight = resolveTimelineHeight(widget.timelineHeight);
|
||||
final propertiesWidth = widget.showProperties
|
||||
? WorkspaceLayoutMetrics.propertiesPanelWidth
|
||||
: 0.0;
|
||||
final mediaMaximumWidth = math.max(
|
||||
0.0,
|
||||
constraints.maxWidth -
|
||||
WorkspaceLayoutMetrics.previewMinimumWidth -
|
||||
gap -
|
||||
(widget.showProperties ? propertiesWidth + gap : 0),
|
||||
);
|
||||
final mediaMinimumWidth = math.min(
|
||||
WorkspaceLayoutMetrics.mediaPanelMinimumWidth,
|
||||
mediaMaximumWidth,
|
||||
);
|
||||
final mediaWidth =
|
||||
(widget.mediaWidth ?? WorkspaceLayoutMetrics.mediaPanelWidth)
|
||||
.clamp(mediaMinimumWidth, mediaMaximumWidth)
|
||||
.toDouble();
|
||||
return Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
@@ -130,6 +145,24 @@ class _ExpandedEditorLayoutState extends State<ExpandedEditorLayout> {
|
||||
),
|
||||
],
|
||||
),
|
||||
if (widget.showMedia)
|
||||
Positioned(
|
||||
key: const Key('editor-media-divider'),
|
||||
left: mediaWidth - WorkspaceLayoutMetrics.desktopResizeSlop,
|
||||
top: 0,
|
||||
bottom: timelineHeight + gap,
|
||||
width: WorkspaceLayoutMetrics.desktopResizeHitExtent,
|
||||
child: WorkspaceResizeHandle(
|
||||
key: const Key('editor-media-resize'),
|
||||
highlightTargets: const {WorkspaceResizeBoundary.media},
|
||||
axis: Axis.horizontal,
|
||||
initialValue: mediaWidth,
|
||||
onResize: (width) => widget.onMediaWidthChanged(
|
||||
width.clamp(mediaMinimumWidth, mediaMaximumWidth).toDouble(),
|
||||
),
|
||||
onEnd: widget.onMediaWidthChangeEnd,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
key: const Key('editor-timeline-divider'),
|
||||
left: 0,
|
||||
@@ -138,15 +171,39 @@ class _ExpandedEditorLayoutState extends State<ExpandedEditorLayout> {
|
||||
height: WorkspaceLayoutMetrics.desktopResizeHitExtent,
|
||||
child: WorkspaceResizeHandle(
|
||||
key: const Key('editor-timeline-resize'),
|
||||
highlightTargets: const {WorkspaceResizeBoundary.timeline},
|
||||
axis: Axis.vertical,
|
||||
initialValue: timelineHeight,
|
||||
direction: -1,
|
||||
onResize: (height) => widget.onTimelineHeightChanged(
|
||||
height.clamp(minimum, maximum).toDouble(),
|
||||
),
|
||||
onResize: (height) =>
|
||||
widget.onTimelineHeightChanged(resolveTimelineHeight(height)),
|
||||
onEnd: widget.onTimelineHeightChangeEnd,
|
||||
),
|
||||
),
|
||||
if (widget.showMedia)
|
||||
Positioned(
|
||||
left: mediaWidth - WorkspaceLayoutMetrics.desktopResizeSlop,
|
||||
bottom: timelineHeight - WorkspaceLayoutMetrics.desktopResizeSlop,
|
||||
width: WorkspaceLayoutMetrics.desktopResizeHitExtent,
|
||||
height: WorkspaceLayoutMetrics.desktopResizeHitExtent,
|
||||
child: WorkspaceResizeHandle.junction(
|
||||
key: const Key('editor-media-timeline-junction'),
|
||||
highlightTargets: const {
|
||||
WorkspaceResizeBoundary.media,
|
||||
WorkspaceResizeBoundary.timeline,
|
||||
},
|
||||
initialWidth: mediaWidth,
|
||||
initialHeight: timelineHeight,
|
||||
verticalDirection: -1,
|
||||
onWidthChanged: (width) => widget.onMediaWidthChanged(
|
||||
width.clamp(mediaMinimumWidth, mediaMaximumWidth).toDouble(),
|
||||
),
|
||||
onHeightChanged: (height) => widget.onTimelineHeightChanged(
|
||||
resolveTimelineHeight(height),
|
||||
),
|
||||
onEnd: widget.onJunctionResizeEnd,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user