feat: OneNote-style notebooks, text fonts, and page navigation
All checks were successful
CI / Windows build (push) Successful in 8m42s
All checks were successful
CI / Windows build (push) Successful in 8m42s
Add notebook.json containers with multi-member pages, fix PDF text editing (size/bold/drag/double-tap), index SidecarText in search, and share keyboard page shortcuts plus a PDF scrubber. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
57
lib/editor/ui/page_nav_shortcuts.dart
Normal file
57
lib/editor/ui/page_nav_shortcuts.dart
Normal file
@@ -0,0 +1,57 @@
|
||||
// lib/editor/ui/page_nav_shortcuts.dart
|
||||
//
|
||||
// Shared keyboard page navigation for PDF / slide / office editors.
|
||||
// Arrow keys + PageUp/PageDown (+ Home/End when provided).
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class PreviousPageIntent extends Intent {
|
||||
const PreviousPageIntent();
|
||||
}
|
||||
|
||||
class NextPageIntent extends Intent {
|
||||
const NextPageIntent();
|
||||
}
|
||||
|
||||
class FirstPageIntent extends Intent {
|
||||
const FirstPageIntent();
|
||||
}
|
||||
|
||||
class LastPageIntent extends Intent {
|
||||
const LastPageIntent();
|
||||
}
|
||||
|
||||
/// Wraps [child] so ←/→/PageUp/PageDown(/Home/End) drive page changes.
|
||||
Widget pageNavShortcuts({
|
||||
required Widget child,
|
||||
required VoidCallback? onPrevious,
|
||||
required VoidCallback? onNext,
|
||||
VoidCallback? onFirst,
|
||||
VoidCallback? onLast,
|
||||
}) {
|
||||
return Focus(
|
||||
autofocus: true,
|
||||
child: CallbackShortcuts(
|
||||
bindings: <ShortcutActivator, VoidCallback>{
|
||||
const SingleActivator(LogicalKeyboardKey.arrowLeft): () =>
|
||||
onPrevious?.call(),
|
||||
const SingleActivator(LogicalKeyboardKey.arrowUp): () =>
|
||||
onPrevious?.call(),
|
||||
const SingleActivator(LogicalKeyboardKey.pageUp): () =>
|
||||
onPrevious?.call(),
|
||||
const SingleActivator(LogicalKeyboardKey.arrowRight): () =>
|
||||
onNext?.call(),
|
||||
const SingleActivator(LogicalKeyboardKey.arrowDown): () =>
|
||||
onNext?.call(),
|
||||
const SingleActivator(LogicalKeyboardKey.pageDown): () =>
|
||||
onNext?.call(),
|
||||
if (onFirst != null)
|
||||
const SingleActivator(LogicalKeyboardKey.home): onFirst,
|
||||
if (onLast != null)
|
||||
const SingleActivator(LogicalKeyboardKey.end): onLast,
|
||||
},
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user