Skip to content

Commit

Permalink
Fix analysis tab bar view background color
Browse files Browse the repository at this point in the history
  • Loading branch information
veloce committed Feb 15, 2025
1 parent fc2e6e5 commit 7074971
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 56 deletions.
7 changes: 6 additions & 1 deletion lib/src/view/analysis/analysis_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,12 @@ class AnalysisLayout extends StatelessWidget {
horizontal: kTabletBoardTableSidePadding,
)
: EdgeInsets.zero,
child: TabBarView(controller: tabController, children: children),
child: Container(
decoration: BoxDecoration(
color: ColorScheme.of(context).surfaceContainerLowest,
),
child: TabBarView(controller: tabController, children: children),
),
),
),
],
Expand Down
29 changes: 12 additions & 17 deletions lib/src/view/analysis/tree_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,18 @@ class AnalysisTreeView extends ConsumerWidget {
// enable computer analysis takes effect here only if it's a lichess game
final enableComputerAnalysis = !options.isLichessGameAnalysis || prefs.enableComputerAnalysis;

return ColoredBox(
color: ColorScheme.of(context).surfaceContainer,
child: SingleChildScrollView(
padding: EdgeInsets.zero,
child: DebouncedPgnTreeView(
root: root,
currentPath: currentPath,
pgnRootComments: pgnRootComments,
notifier: ref.read(ctrlProvider.notifier),
shouldShowComputerVariations: enableComputerAnalysis,
shouldShowComments: enableComputerAnalysis && prefs.showPgnComments,
shouldShowAnnotations: enableComputerAnalysis && prefs.showAnnotations,
displayMode:
prefs.inlineNotation
? PgnTreeDisplayMode.inlineNotation
: PgnTreeDisplayMode.twoColumn,
),
return SingleChildScrollView(
padding: EdgeInsets.zero,
child: DebouncedPgnTreeView(
root: root,
currentPath: currentPath,
pgnRootComments: pgnRootComments,
notifier: ref.read(ctrlProvider.notifier),
shouldShowComputerVariations: enableComputerAnalysis,
shouldShowComments: enableComputerAnalysis && prefs.showPgnComments,
shouldShowAnnotations: enableComputerAnalysis && prefs.showAnnotations,
displayMode:
prefs.inlineNotation ? PgnTreeDisplayMode.inlineNotation : PgnTreeDisplayMode.twoColumn,
),
);
}
Expand Down
19 changes: 8 additions & 11 deletions lib/src/view/broadcast/broadcast_game_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -242,17 +242,14 @@ class _BroadcastGameTreeView extends ConsumerWidget {

final analysisPrefs = ref.watch(analysisPreferencesProvider);

return ColoredBox(
color: ColorScheme.of(context).surfaceContainer,
child: SingleChildScrollView(
child: DebouncedPgnTreeView(
root: state.root,
currentPath: state.currentPath,
broadcastLivePath: state.broadcastLivePath,
pgnRootComments: state.pgnRootComments,
shouldShowAnnotations: analysisPrefs.showAnnotations,
notifier: ref.read(ctrlProvider.notifier),
),
return SingleChildScrollView(
child: DebouncedPgnTreeView(
root: state.root,
currentPath: state.currentPath,
broadcastLivePath: state.broadcastLivePath,
pgnRootComments: state.pgnRootComments,
shouldShowAnnotations: analysisPrefs.showAnnotations,
notifier: ref.read(ctrlProvider.notifier),
),
);
}
Expand Down
3 changes: 1 addition & 2 deletions lib/src/view/study/study_gamebook.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ class StudyGamebook extends StatelessWidget {

@override
Widget build(BuildContext context) {
return Container(
color: ColorScheme.of(context).surfaceContainer,
return Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
Expand Down
47 changes: 22 additions & 25 deletions lib/src/view/study/study_tree_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,30 @@ class StudyTreeView extends ConsumerWidget {

final analysisPrefs = ref.watch(analysisPreferencesProvider);

return ColoredBox(
color: ColorScheme.of(context).surfaceContainer,
child: CustomScrollView(
slivers: [
SliverFillRemaining(
hasScrollBody: false,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: DebouncedPgnTreeView(
root: root,
currentPath: currentPath,
pgnRootComments: pgnRootComments,
notifier: ref.read(studyControllerProvider(id).notifier),
shouldShowAnnotations: analysisPrefs.showAnnotations,
displayMode:
analysisPrefs.inlineNotation
? PgnTreeDisplayMode.inlineNotation
: PgnTreeDisplayMode.twoColumn,
),
return CustomScrollView(
slivers: [
SliverFillRemaining(
hasScrollBody: false,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: DebouncedPgnTreeView(
root: root,
currentPath: currentPath,
pgnRootComments: pgnRootComments,
notifier: ref.read(studyControllerProvider(id).notifier),
shouldShowAnnotations: analysisPrefs.showAnnotations,
displayMode:
analysisPrefs.inlineNotation
? PgnTreeDisplayMode.inlineNotation
: PgnTreeDisplayMode.twoColumn,
),
],
),
),
],
),
],
),
),
],
);
}
}

0 comments on commit 7074971

Please sign in to comment.