diff --git a/apps/desktop/lib/src/schedule/ui/schedule_card.dart b/apps/desktop/lib/src/schedule/ui/schedule_card.dart index 3636987..b3e349e 100644 --- a/apps/desktop/lib/src/schedule/ui/schedule_card.dart +++ b/apps/desktop/lib/src/schedule/ui/schedule_card.dart @@ -1,3 +1,4 @@ +import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import '../schedule_model.dart'; @@ -100,11 +101,17 @@ class DayColumn extends StatelessWidget { ? Center( child: Text('—', style: TextStyle(color: scheme.onSurfaceVariant)), ) - : ListView.separated( - padding: const EdgeInsets.fromLTRB(8, 0, 8, 10), - itemCount: cards.length, - separatorBuilder: (_, _) => SizedBox(height: compact ? 6 : 10), - itemBuilder: (context, i) => cards[i], + // The board's mouse drag is sideways only: a column scrolls by + // wheel (or touch), never by dragging the mouse. + : ScrollConfiguration( + behavior: ScrollConfiguration.of(context) + .copyWith(dragDevices: {...PointerDeviceKind.values}..remove(PointerDeviceKind.mouse)), + child: ListView.separated( + padding: const EdgeInsets.fromLTRB(8, 0, 8, 10), + itemCount: cards.length, + separatorBuilder: (_, _) => SizedBox(height: compact ? 6 : 10), + itemBuilder: (context, i) => cards[i], + ), ), ), ), diff --git a/apps/desktop/lib/src/schedule/ui/schedule_page.dart b/apps/desktop/lib/src/schedule/ui/schedule_page.dart index b7995b8..5351441 100644 --- a/apps/desktop/lib/src/schedule/ui/schedule_page.dart +++ b/apps/desktop/lib/src/schedule/ui/schedule_page.dart @@ -501,6 +501,7 @@ class _SchedulePageState extends State { (byDay[DateTime(l.year, l.month, l.day)] ??= []).add(e); } return HScroll( + wheel: false, controller: _scroll, builder: (c) => ListView.separated( key: const ValueKey('schedule-board'), diff --git a/apps/desktop/lib/src/shell/motion.dart b/apps/desktop/lib/src/shell/motion.dart index bdd785f..bd66374 100644 --- a/apps/desktop/lib/src/shell/motion.dart +++ b/apps/desktop/lib/src/shell/motion.dart @@ -89,7 +89,11 @@ Future showPopover( class HScroll extends StatefulWidget { final ScrollController? controller; final Widget Function(ScrollController controller) builder; - const HScroll({super.key, this.controller, required this.builder}); + /// Map the plain (vertical) wheel to sideways scrolling. Off where the + /// children scroll vertically themselves (the schedule's day columns): + /// there only mouse drag and Shift+wheel move sideways. + final bool wheel; + const HScroll({super.key, this.controller, required this.builder, this.wheel = true}); @override State createState() => _HScrollState(); @@ -121,6 +125,6 @@ class _HScrollState extends State { Widget build(BuildContext context) => ScrollConfiguration( behavior: ScrollConfiguration.of(context) .copyWith(dragDevices: PointerDeviceKind.values.toSet()), - child: Listener(onPointerSignal: _wheel, child: widget.builder(_c)), + child: widget.wheel ? Listener(onPointerSignal: _wheel, child: widget.builder(_c)) : widget.builder(_c), ); }