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
162 lines
5.4 KiB
Dart
162 lines
5.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/widget_previews.dart';
|
|
|
|
import '../icons/app_icons.dart';
|
|
import '../theme/app_palette.dart';
|
|
import '../theme/app_theme.dart';
|
|
import 'app_command_toolbar.dart';
|
|
|
|
@Preview(
|
|
name: 'Rounded timeline tabs — light',
|
|
group: 'Desktop workspace',
|
|
size: Size(480, 68),
|
|
)
|
|
Widget roundedTimelineControlsLightPreview() => _preview(Brightness.light);
|
|
|
|
@Preview(
|
|
name: 'Rounded timeline tabs — dark',
|
|
group: 'Desktop workspace',
|
|
size: Size(480, 68),
|
|
)
|
|
@Preview(
|
|
name: 'Rounded timeline tabs — narrow',
|
|
group: 'Desktop workspace',
|
|
size: Size(240, 68),
|
|
)
|
|
Widget roundedTimelineControlsDarkPreview() => _preview(Brightness.dark);
|
|
|
|
Widget _preview(Brightness brightness) => MaterialApp(
|
|
debugShowCheckedModeBanner: false,
|
|
theme: AppTheme.desktopWorkspaceTheme(
|
|
AppTheme.forPalette(AppPalette.graphite, brightness),
|
|
),
|
|
home: const Scaffold(body: _TimelineControlsPreview()),
|
|
);
|
|
|
|
class _TimelineControlsPreview extends StatefulWidget {
|
|
const _TimelineControlsPreview();
|
|
|
|
@override
|
|
State<_TimelineControlsPreview> createState() =>
|
|
_TimelineControlsPreviewState();
|
|
}
|
|
|
|
class _TimelineControlsPreviewState extends State<_TimelineControlsPreview> {
|
|
final _timelines = ['Main edit', 'Portrait', 'Outtakes'];
|
|
String _selected = 'Main edit';
|
|
|
|
@override
|
|
Widget build(BuildContext context) => Column(
|
|
children: [
|
|
ColoredBox(
|
|
color: AppTheme.timelineTabsBackground(context),
|
|
child: SizedBox(
|
|
height: AppDesktopMetrics.timelineTabs,
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: AppSpacing.tiny),
|
|
child: Row(
|
|
children: [
|
|
Expanded(
|
|
child: Align(
|
|
alignment: AlignmentDirectional.centerStart,
|
|
child: Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Flexible(
|
|
child: SingleChildScrollView(
|
|
scrollDirection: Axis.horizontal,
|
|
child: Row(
|
|
children: [
|
|
for (final name in _timelines)
|
|
Padding(
|
|
padding: const EdgeInsetsDirectional.only(
|
|
end: AppSpacing.hairline,
|
|
),
|
|
child: Semantics(
|
|
selected: name == _selected,
|
|
child: TextButton(
|
|
style: AppTheme.timelineTabStyle(
|
|
context,
|
|
selected: name == _selected,
|
|
),
|
|
onPressed: () =>
|
|
setState(() => _selected = name),
|
|
child: Text(name),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
IconButton(
|
|
tooltip: 'New timeline',
|
|
style: AppTheme.timelineTabActionStyle,
|
|
onPressed: () => setState(() {
|
|
final name = 'Timeline ${_timelines.length + 1}';
|
|
_timelines.add(name);
|
|
_selected = name;
|
|
}),
|
|
icon: const Icon(AppIcons.add, size: 16),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
IconButton(
|
|
tooltip: 'All timelines',
|
|
style: AppTheme.timelineTabActionStyle,
|
|
onPressed: () {},
|
|
icon: const Icon(AppIcons.more, size: 16),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
SizedBox(
|
|
height: AppDesktopMetrics.timelineToolbar,
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: AppSpacing.small),
|
|
child: AppCommandToolbar(
|
|
groups: [
|
|
[
|
|
AppToolbarCommand(
|
|
label: 'Undo',
|
|
icon: AppIcons.undo,
|
|
onPressed: () {},
|
|
),
|
|
const AppToolbarCommand(
|
|
label: 'Redo',
|
|
icon: AppIcons.redo,
|
|
onPressed: null,
|
|
),
|
|
],
|
|
[
|
|
for (final command in [
|
|
('Split', AppIcons.cut),
|
|
('Trim left', AppIcons.alignLeft),
|
|
('Trim right', AppIcons.alignRight),
|
|
('Delete', AppIcons.delete),
|
|
])
|
|
AppToolbarCommand(
|
|
label: command.$1,
|
|
icon: command.$2,
|
|
onPressed: () {},
|
|
),
|
|
],
|
|
],
|
|
trailing: [
|
|
AppToolbarCommand(
|
|
label: 'Fit timeline',
|
|
icon: AppIcons.fitContent,
|
|
onPressed: () {},
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|