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
60 lines
2.2 KiB
Dart
60 lines
2.2 KiB
Dart
import 'package:cutdex/l10n/l10n.dart';
|
|
import 'package:cutdex_ui/theme.dart';
|
|
import 'package:cutdex_ui/widgets.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
import '../../settings/settings_operation.dart';
|
|
import 'timeline_ruler_settings.dart';
|
|
|
|
class TimelineRulerSettingsField extends ConsumerWidget {
|
|
const TimelineRulerSettingsField({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
if (!AppTheme.isDesktop(context)) return const SizedBox.shrink();
|
|
final layout = ref.watch(timelineRulerSettingsProvider);
|
|
final save = ref.watch(settingsOperationProvider('timeline-ruler'));
|
|
return AppField(
|
|
label: context.l10n.timelineRulerStyle,
|
|
orientation: AppFieldOrientation.horizontal,
|
|
error:
|
|
(save.hasError ? context.l10n.saveAppearanceFailed : null) ??
|
|
(layout.hasError ? context.l10n.loadAppearanceFailed : null),
|
|
child: SizedBox(
|
|
width: AppSettingsMetrics.controlWidth,
|
|
child: AppSelect<TimelineRulerTimecodeLayout>(
|
|
key: const Key('settings-timeline-ruler-style'),
|
|
emptyLabel: context.l10n.noMatchingOptions,
|
|
controlHeight: AppDesktopMetrics.button,
|
|
value: layout.asData?.value ?? TimelineRulerTimecodeLayout.inline,
|
|
label: context.l10n.timelineRulerStyle,
|
|
options: [
|
|
AppSelectOption(
|
|
TimelineRulerTimecodeLayout.inline,
|
|
context.l10n.timelineRulerInline,
|
|
),
|
|
AppSelectOption(
|
|
TimelineRulerTimecodeLayout.centered,
|
|
context.l10n.timelineRulerCentered,
|
|
),
|
|
AppSelectOption(
|
|
TimelineRulerTimecodeLayout.overlay,
|
|
context.l10n.timelineRulerOverlay,
|
|
),
|
|
],
|
|
onChanged: layout.isLoading || save.isLoading
|
|
? null
|
|
: (value) => ref
|
|
.read(settingsOperationProvider('timeline-ruler').notifier)
|
|
.run(
|
|
() => ref
|
|
.read(timelineRulerSettingsProvider.notifier)
|
|
.setLayout(value),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|