diff --git a/lib/pages/chat/chat_app_bar_list_tile.dart b/lib/pages/chat/chat_app_bar_list_tile.dart index 1e0ec8259..259144251 100644 --- a/lib/pages/chat/chat_app_bar_list_tile.dart +++ b/lib/pages/chat/chat_app_bar_list_tile.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_linkify/flutter_linkify.dart'; -import 'package:fluffychat/config/app_config.dart'; import 'package:fluffychat/utils/url_launcher.dart'; class ChatAppBarListTile extends StatelessWidget { @@ -11,6 +10,8 @@ class ChatAppBarListTile extends StatelessWidget { final Widget? trailing; final void Function()? onTap; + static const double fixedHeight = 40.0; + const ChatAppBarListTile({ super.key, this.leading, @@ -23,38 +24,40 @@ class ChatAppBarListTile extends StatelessWidget { Widget build(BuildContext context) { final leading = this.leading; final trailing = this.trailing; - final fontSize = AppConfig.messageFontSize * AppConfig.fontSizeFactor; - return InkWell( - onTap: onTap, - child: Row( - children: [ - if (leading != null) leading, - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 4.0), - child: Linkify( - text: title, - options: const LinkifyOptions(humanize: false), - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Theme.of(context).colorScheme.onSurfaceVariant, + return SizedBox( + height: fixedHeight, + child: InkWell( + onTap: onTap, + child: Row( + children: [ + if (leading != null) leading, + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 4.0), + child: Linkify( + text: title, + options: const LinkifyOptions(humanize: false), + maxLines: 1, overflow: TextOverflow.ellipsis, - fontSize: fontSize, - ), - linkStyle: TextStyle( - color: Theme.of(context).colorScheme.onSurfaceVariant, - fontSize: fontSize, - decoration: TextDecoration.underline, - decorationColor: - Theme.of(context).colorScheme.onSurfaceVariant, + style: TextStyle( + color: Theme.of(context).colorScheme.onSurfaceVariant, + overflow: TextOverflow.ellipsis, + fontSize: 14, + ), + linkStyle: TextStyle( + color: Theme.of(context).colorScheme.onSurfaceVariant, + fontSize: 14, + decoration: TextDecoration.underline, + decorationColor: + Theme.of(context).colorScheme.onSurfaceVariant, + ), + onOpen: (url) => UrlLauncher(context, url.url).launchUrl(), ), - onOpen: (url) => UrlLauncher(context, url.url).launchUrl(), ), ), - ), - if (trailing != null) trailing, - ], + if (trailing != null) trailing, + ], + ), ), ); } diff --git a/lib/pages/chat/chat_view.dart b/lib/pages/chat/chat_view.dart index 80a84fa41..422175f0f 100644 --- a/lib/pages/chat/chat_view.dart +++ b/lib/pages/chat/chat_view.dart @@ -158,15 +158,15 @@ class ChatView extends StatelessWidget { builder: (BuildContext context, snapshot) { var appbarBottomHeight = 0.0; if (controller.room.pinnedEventIds.isNotEmpty) { - appbarBottomHeight += 42; + appbarBottomHeight += ChatAppBarListTile.fixedHeight; } if (scrollUpBannerEventId != null) { - appbarBottomHeight += 42; + appbarBottomHeight += ChatAppBarListTile.fixedHeight; } final tombstoneEvent = controller.room.getState(EventTypes.RoomTombstone); if (tombstoneEvent != null) { - appbarBottomHeight += 42; + appbarBottomHeight += ChatAppBarListTile.fixedHeight; } return Scaffold( appBar: AppBar( diff --git a/lib/pages/chat/pinned_events.dart b/lib/pages/chat/pinned_events.dart index 0940a786f..7afe413db 100644 --- a/lib/pages/chat/pinned_events.dart +++ b/lib/pages/chat/pinned_events.dart @@ -71,8 +71,8 @@ class PinnedEvents extends StatelessWidget { ) ?? L10n.of(context)!.loadingPleaseWait, leading: IconButton( - splashRadius: 20, - iconSize: 20, + splashRadius: 18, + iconSize: 18, color: Theme.of(context).colorScheme.onSurfaceVariant, icon: const Icon(Icons.push_pin), tooltip: L10n.of(context)!.unpin,