diff --git a/lib/ui/screens/artifact/artifact_carousel/artifact_carousel_screen.dart b/lib/ui/screens/artifact/artifact_carousel/artifact_carousel_screen.dart index 8313bc4b..b9eccd91 100644 --- a/lib/ui/screens/artifact/artifact_carousel/artifact_carousel_screen.dart +++ b/lib/ui/screens/artifact/artifact_carousel/artifact_carousel_screen.dart @@ -55,7 +55,8 @@ class _ArtifactScreenState extends State { @override Widget build(BuildContext context) { bool shortMode = context.heightPx <= 800; - final double bottomHeight = context.heightPx / 2.75; // Prev 340, dynamic seems to work better + bool overlapMode = context.heightPx <= 450; + final double bottomHeight = context.heightPx / (overlapMode ? 2 : 2.75); // Prev 340, dynamic seems to work better // Allow objects to become wider as the screen becomes tall, this allows // them to grow taller as well, filling the available space better. double itemHeight = (context.heightPx - 200 - bottomHeight).clamp(250, 400); @@ -122,6 +123,7 @@ class _ArtifactScreenState extends State { artifact: _artifacts[value], height: bottomHeight, shortMode: shortMode, + overlapMode: overlapMode, state: this, ), ), diff --git a/lib/ui/screens/artifact/artifact_carousel/widgets/_bottom_text_content.dart b/lib/ui/screens/artifact/artifact_carousel/widgets/_bottom_text_content.dart index cd723c91..017ec818 100644 --- a/lib/ui/screens/artifact/artifact_carousel/widgets/_bottom_text_content.dart +++ b/lib/ui/screens/artifact/artifact_carousel/widgets/_bottom_text_content.dart @@ -2,16 +2,30 @@ part of '../artifact_carousel_screen.dart'; class _BottomTextContent extends StatelessWidget { const _BottomTextContent( - {super.key, required this.artifact, required this.height, required this.state, required this.shortMode}); + {super.key, + required this.artifact, + required this.height, + required this.state, + required this.shortMode, + required this.overlapMode}); final HighlightData artifact; final double height; final _ArtifactScreenState state; final bool shortMode; + final bool overlapMode; int get _currentPage => state._currentPage.value.round(); @override Widget build(BuildContext context) { + Widget textContent = Text( + artifact.title, + overflow: TextOverflow.ellipsis, + style: $styles.text.h2.copyWith(color: $styles.colors.black, height: 1.2, fontSize: 32), + textAlign: TextAlign.center, + maxLines: 2, + ); + return Container( width: $styles.sizes.maxContentWidth2, height: height, @@ -40,13 +54,15 @@ class _BottomTextContent extends StatelessWidget { SizedBox(width: double.infinity), // Stop text from scaling to make layout a little easier, it's already quite large StaticTextScale( - child: Text( - artifact.title, - overflow: TextOverflow.ellipsis, - style: $styles.text.h2.copyWith(color: $styles.colors.black, height: 1.2, fontSize: 32), - textAlign: TextAlign.center, - maxLines: 2, - ), + child: overlapMode + ? Container( + padding: EdgeInsets.all($styles.insets.xxs), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular($styles.corners.md), + color: $styles.colors.white.withAlpha(130), + ), + child: textContent) + : textContent, ), if (!shortMode) ...[ Gap($styles.insets.xxs), @@ -70,13 +86,13 @@ class _BottomTextContent extends StatelessWidget { controller: state._pageController!, semanticPageTitle: $strings.artifactsSemanticArtifact, ), - Gap($styles.insets.md), + if (!shortMode) Gap($styles.insets.md), AppBtn.from( text: $strings.artifactsButtonBrowse, expand: true, onPressed: state._handleSearchTap, ), - Gap($styles.insets.lg), + if (!shortMode) Gap($styles.insets.lg) else Gap($styles.insets.md), ], ), ],