Skip to content

Commit

Permalink
Merge pull request #832 from tom-anders/extendzen
Browse files Browse the repository at this point in the history
feat: hide move list in zen mode
  • Loading branch information
veloce authored Jul 16, 2024
2 parents e372a19 + 4528c9e commit 66cae78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/src/view/game/game_body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ class GameBody extends ConsumerWidget {
onSelectMove: (moveIndex) {
ref.read(ctrlProvider.notifier).cursorAt(moveIndex);
},
zenMode: gameState.isZenModeActive,
),
),
),
Expand Down
9 changes: 7 additions & 2 deletions lib/src/widgets/board_table.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class BoardTable extends ConsumerStatefulWidget {
this.showMoveListPlaceholder = false,
this.showEngineGaugePlaceholder = false,
this.boardKey,
this.zenMode = false,
super.key,
}) : assert(
moves == null || currentMoveIndex != null,
Expand Down Expand Up @@ -92,6 +93,9 @@ class BoardTable extends ConsumerStatefulWidget {
/// Whether to show the engine gauge placeholder.
final bool showEngineGaugePlaceholder;

/// If true, the move list will be hidden
final bool zenMode;

@override
ConsumerState<BoardTable> createState() => _BoardTableState();
}
Expand Down Expand Up @@ -243,7 +247,7 @@ class _BoardTableState extends ConsumerState<BoardTable> {
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Flexible(child: widget.topTable),
if (slicedMoves != null)
if (!widget.zenMode && slicedMoves != null)
Expanded(
child: Padding(
padding: const EdgeInsets.all(16.0),
Expand Down Expand Up @@ -275,7 +279,8 @@ class _BoardTableState extends ConsumerState<BoardTable> {
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (slicedMoves != null &&
if (!widget.zenMode &&
slicedMoves != null &&
verticalSpaceLeftBoardOnPortrait >= 130)
MoveList(
type: MoveListType.inline,
Expand Down

0 comments on commit 66cae78

Please sign in to comment.