From 4151b4e84824607b5b095bcdeedff0025287d757 Mon Sep 17 00:00:00 2001 From: Castropy Date: Thu, 15 Jan 2026 19:20:36 -0400 Subject: [PATCH] fix: resolve overflow in title bar (#1159) --- lib/home.dart | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/lib/home.dart b/lib/home.dart index e94bb9129..dd396733e 100644 --- a/lib/home.dart +++ b/lib/home.dart @@ -401,26 +401,37 @@ B Srinivas, Kevin Wang, Zheyuan Xu, Yixiang Yin, Bo Zhang. appBar: AppBar( backgroundColor: flavor.mantle, - // The title aligned to the left. - + // The title aligned to the left. //title: const Text(appTitle), title: Row( - children: [ - Image.asset('assets/icons/icon.png', width: 40, height: 40), - configWidgetGap, - MarkdownBody( - data: appTitle, - onTapLink: (text, href, title) { - final Uri url = Uri.parse(href ?? ''); - launchUrl(url); - }, - styleSheet: MarkdownStyleSheet( - p: const TextStyle(fontSize: 24, fontWeight: FontWeight.bold), - a: const TextStyle(fontSize: 24, fontWeight: FontWeight.bold), - ), - ), - ], + children: [ + Image.asset('assets/icons/icon.png', width: 40, height: 40), + configWidgetGap, + // Wrap markdownbody in expanded, so that it doesn't push outwards + Expanded( + child: MarkdownBody( + data: appTitle, + softLineBreak: false, //Prevent the text from jumping to a second line + onTapLink: (text, href, title) { + final Uri url = Uri.parse(href ?? ''); + launchUrl(url); + }, + styleSheet: MarkdownStyleSheet( + p: const TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + overflow: TextOverflow.ellipsis, // Add "..." if there's not enough space + ), + a: const TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + overflow: TextOverflow.ellipsis, + ), ), + ), + ), + ], +), // Deploy the buttons aligned to the top right for actions. actions: [