Skip to content

Commit

Permalink
Use mac scroll physics when in mac emulation
Browse files Browse the repository at this point in the history
  • Loading branch information
moffatman committed Aug 13, 2022
1 parent b896d91 commit 9d6b297
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/pages/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'package:chan/models/thread.dart';
import 'package:chan/pages/board.dart';
import 'package:chan/pages/licenses.dart';
import 'package:chan/pages/thread.dart';
import 'package:chan/services/apple.dart';
import 'package:chan/services/filtering.dart';
import 'package:chan/services/imageboard.dart';
import 'package:chan/services/persistence.dart';
Expand Down Expand Up @@ -56,7 +57,7 @@ class _SettingsPage extends StatelessWidget {
child: SafeArea(
child: MaybeCupertinoScrollbar(
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
physics: isOnMac ? const BouncingDesktopScrollPhysics() : const BouncingScrollPhysics(),
child: Align(
alignment: Alignment.center,
child: ConstrainedBox(
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/refreshable_list.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:async';
import 'dart:math';

import 'package:chan/services/apple.dart';
import 'package:chan/services/filtering.dart';
import 'package:chan/services/settings.dart';
import 'package:chan/services/util.dart';
Expand Down Expand Up @@ -356,7 +357,7 @@ class RefreshableListState<T> extends State<RefreshableList<T>> with TickerProvi
key: _scrollViewKey,
cacheExtent: 1000,
controller: widget.controller?.scrollController,
physics: const BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()),
physics: isOnMac ? const BouncingDesktopScrollPhysics(parent: AlwaysScrollableScrollPhysics()) : const BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()),
slivers: [
SliverSafeArea(
sliver: widget.disableUpdates ? SliverToBoxAdapter(
Expand Down

0 comments on commit 9d6b297

Please sign in to comment.