Keep a long reply region chip inside the composer quote
This commit is contained in:
1 parent
bc0062363d
commit
3f4215a955
3 files changed
+47
-26
No files matched your search
@@ -2670,6 +2670,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
),
|
||||
child: Text(
|
||||
context.l10n.channels_regionSetTo(replyRegion!),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style:
|
||||
MeshTheme.mono(
|
||||
fontSize: 12 * textScale,
|
||||
|
||||
@@ -468,34 +468,45 @@ class ChatComposerQuote extends StatelessWidget {
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(10, 6, 0, 6),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
fontWeight: FontWeight.w700,
|
||||
color: accent,
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) => Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
fontWeight: FontWeight.w700,
|
||||
color: accent,
|
||||
),
|
||||
),
|
||||
),
|
||||
content,
|
||||
],
|
||||
content,
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
?trailing,
|
||||
IconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
tooltip: dismissTooltip,
|
||||
color: scheme.onSurfaceVariant,
|
||||
onPressed: onDismiss,
|
||||
),
|
||||
],
|
||||
// The quote shares its row with Send, so a long trailing
|
||||
// control (a region chip) must not squeeze out the message
|
||||
// or the dismiss button.
|
||||
if (trailing != null)
|
||||
ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: constraints.maxWidth * 0.4,
|
||||
),
|
||||
child: trailing,
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
tooltip: dismissTooltip,
|
||||
color: scheme.onSurfaceVariant,
|
||||
onPressed: onDismiss,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -479,10 +479,18 @@ void main() {
|
||||
),
|
||||
onDismiss: () {},
|
||||
dismissTooltip: _l10n.chat_cancelReply,
|
||||
// A long region chip, as a channel reply shows.
|
||||
trailing: Text(
|
||||
_l10n.channels_regionSetTo('north-west-valley'),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
expect(tester.takeException(), isNull);
|
||||
expect(find.byTooltip(_l10n.chat_cancelReply), findsOneWidget);
|
||||
await _type(tester, 'a' * 19);
|
||||
expect(tester.takeException(), isNull);
|
||||
|
||||
|
||||
Reference in new issue
Block a user