diff --git a/src/kaiteki/lib/ui/main/views/kaiteki.dart b/src/kaiteki/lib/ui/main/views/kaiteki.dart index e4f9e916..2ed0e041 100644 --- a/src/kaiteki/lib/ui/main/views/kaiteki.dart +++ b/src/kaiteki/lib/ui/main/views/kaiteki.dart @@ -86,7 +86,7 @@ class _KaitekiMainScreenViewState extends ConsumerState { return Scaffold( backgroundColor: isCompact ? null : getOutsideColor(context), - appBar: buildAppBar(context), + appBar: buildAppBar(context, !isCompact), body: isCompact ? body : _buildDesktopView( @@ -281,7 +281,7 @@ class _KaitekiMainScreenViewState extends ConsumerState { ); } - PreferredSizeWidget buildAppBar(BuildContext context) { + PreferredSizeWidget buildAppBar(BuildContext context, bool immerse) { if (ref.watch(useSearchBar).value) { return PreferredSize( preferredSize: const Size.fromHeight(56.0 + 8.0 * 2), @@ -306,18 +306,20 @@ class _KaitekiMainScreenViewState extends ConsumerState { ); } - Color? foregroundColor; + Color? backgroundColor, foregroundColor; - final outsideColor = getOutsideColor(context); - if (outsideColor != null) { - foregroundColor = ThemeData.estimateBrightnessForColor(outsideColor) - .inverted - .getColor(); + if (immerse) { + final backgroundColor = getOutsideColor(context); + if (backgroundColor != null) { + foregroundColor = ThemeData.estimateBrightnessForColor(backgroundColor) + .inverted + .getColor(); + } } final theme = Theme.of(context); return AppBar( - backgroundColor: outsideColor, + backgroundColor: backgroundColor, foregroundColor: foregroundColor, title: Text( appName, @@ -325,7 +327,7 @@ class _KaitekiMainScreenViewState extends ConsumerState { ), actions: _buildAppBarActions(context), elevation: 0.0, - scrolledUnderElevation: outsideColor != null ? 0.0 : 4.0, + scrolledUnderElevation: immerse ? 0.0 : 4.0, ); } }