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(
|
child: Text(
|
||||||
context.l10n.channels_regionSetTo(replyRegion!),
|
context.l10n.channels_regionSetTo(replyRegion!),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
style:
|
style:
|
||||||
MeshTheme.mono(
|
MeshTheme.mono(
|
||||||
fontSize: 12 * textScale,
|
fontSize: 12 * textScale,
|
||||||
|
|||||||
@@ -468,34 +468,45 @@ class ChatComposerQuote extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(10, 6, 0, 6),
|
padding: const EdgeInsetsDirectional.fromSTEB(10, 6, 0, 6),
|
||||||
child: Row(
|
child: LayoutBuilder(
|
||||||
children: [
|
builder: (context, constraints) => Row(
|
||||||
Expanded(
|
children: [
|
||||||
child: Column(
|
Expanded(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
mainAxisSize: MainAxisSize.min,
|
||||||
Text(
|
children: [
|
||||||
title,
|
Text(
|
||||||
maxLines: 1,
|
title,
|
||||||
overflow: TextOverflow.ellipsis,
|
maxLines: 1,
|
||||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
overflow: TextOverflow.ellipsis,
|
||||||
fontWeight: FontWeight.w700,
|
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||||
color: accent,
|
fontWeight: FontWeight.w700,
|
||||||
|
color: accent,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
content,
|
||||||
content,
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
// The quote shares its row with Send, so a long trailing
|
||||||
?trailing,
|
// control (a region chip) must not squeeze out the message
|
||||||
IconButton(
|
// or the dismiss button.
|
||||||
icon: const Icon(Icons.close),
|
if (trailing != null)
|
||||||
tooltip: dismissTooltip,
|
ConstrainedBox(
|
||||||
color: scheme.onSurfaceVariant,
|
constraints: BoxConstraints(
|
||||||
onPressed: onDismiss,
|
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: () {},
|
onDismiss: () {},
|
||||||
dismissTooltip: _l10n.chat_cancelReply,
|
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();
|
await tester.pumpAndSettle();
|
||||||
|
expect(tester.takeException(), isNull);
|
||||||
|
expect(find.byTooltip(_l10n.chat_cancelReply), findsOneWidget);
|
||||||
await _type(tester, 'a' * 19);
|
await _type(tester, 'a' * 19);
|
||||||
expect(tester.takeException(), isNull);
|
expect(tester.takeException(), isNull);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user