From 6102f32587fe1ad13074336266f94d8cf43222db Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Tue, 6 Aug 2024 10:36:18 -0700 Subject: [PATCH] fix fitting --- lib/contacts/views/contacts_dialog.dart | 51 ++++++++++++++----------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/lib/contacts/views/contacts_dialog.dart b/lib/contacts/views/contacts_dialog.dart index 8d65338..6a963f5 100644 --- a/lib/contacts/views/contacts_dialog.dart +++ b/lib/contacts/views/contacts_dialog.dart @@ -75,29 +75,36 @@ class _ContactsDialogState extends State { : null, actions: [ if (_selectedContact != null) - Column(mainAxisSize: MainAxisSize.min, children: [ - IconButton( - icon: const Icon(Icons.chat_bubble), - tooltip: translate('contacts_dialog.new_chat'), - onPressed: () async { - await onChatStarted(_selectedContact!); - }), - Text(translate('contacts_dialog.new_chat'), - style: theme.textTheme.labelSmall! - .copyWith(color: scale.primaryScale.borderText)), - ]).paddingLTRB(8, 0, 8, 0), + FittedBox( + fit: BoxFit.scaleDown, + child: + Column(mainAxisSize: MainAxisSize.min, children: [ + IconButton( + icon: const Icon(Icons.chat_bubble), + tooltip: translate('contacts_dialog.new_chat'), + onPressed: () async { + await onChatStarted(_selectedContact!); + }), + Text(translate('contacts_dialog.new_chat'), + style: theme.textTheme.labelSmall!.copyWith( + color: scale.primaryScale.borderText)), + ])).paddingLTRB(8, 0, 8, 0), if (enableSplit && _selectedContact != null) - Column(mainAxisSize: MainAxisSize.min, children: [ - IconButton( - icon: const Icon(Icons.close), - tooltip: translate('contacts_dialog.close_contact'), - onPressed: () async { - await onContactSelected(null); - }), - Text(translate('contacts_dialog.close_contact'), - style: theme.textTheme.labelSmall! - .copyWith(color: scale.primaryScale.borderText)), - ]).paddingLTRB(8, 0, 8, 0), + FittedBox( + fit: BoxFit.scaleDown, + child: + Column(mainAxisSize: MainAxisSize.min, children: [ + IconButton( + icon: const Icon(Icons.close), + tooltip: + translate('contacts_dialog.close_contact'), + onPressed: () async { + await onContactSelected(null); + }), + Text(translate('contacts_dialog.close_contact'), + style: theme.textTheme.labelSmall!.copyWith( + color: scale.primaryScale.borderText)), + ])).paddingLTRB(8, 0, 8, 0), ]), body: LayoutBuilder(builder: (context, constraint) { final maxWidth = constraint.maxWidth;