Skip to content

Commit 145e99f

Browse files
committed
msglist [nfc]: Distribute a 4px bottom padding down to conditional cases
To prepare for adjusting one of the cases from 4px to 2px: zulip#1535 (comment)
1 parent 47680e9 commit 145e99f

File tree

1 file changed

+39
-31
lines changed

1 file changed

+39
-31
lines changed

lib/widgets/message_list.dart

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,7 @@ class MessageWithPossibleSender extends StatelessWidget {
15371537
behavior: HitTestBehavior.translucent,
15381538
onLongPress: () => showMessageActionSheet(context: context, message: message),
15391539
child: Padding(
1540-
padding: const EdgeInsets.symmetric(vertical: 4),
1540+
padding: const EdgeInsets.only(top: 4),
15411541
child: Column(children: [
15421542
if (item.showSender)
15431543
_SenderRow(message: message, showTimestamp: true),
@@ -1555,14 +1555,18 @@ class MessageWithPossibleSender extends StatelessWidget {
15551555
if (editMessageErrorStatus != null)
15561556
_EditMessageStatusRow(messageId: message.id, status: editMessageErrorStatus)
15571557
else if (editStateText != null)
1558-
Text(editStateText,
1559-
textAlign: TextAlign.end,
1560-
style: TextStyle(
1561-
color: designVariables.labelEdited,
1562-
fontSize: 12,
1563-
height: (12 / 12),
1564-
letterSpacing: proportionalLetterSpacing(
1565-
context, 0.05, baseFontSize: 12))),
1558+
Padding(
1559+
padding: const EdgeInsets.only(bottom: 4),
1560+
child: Text(editStateText,
1561+
textAlign: TextAlign.end,
1562+
style: TextStyle(
1563+
color: designVariables.labelEdited,
1564+
fontSize: 12,
1565+
height: (12 / 12),
1566+
letterSpacing: proportionalLetterSpacing(context,
1567+
0.05, baseFontSize: 12))))
1568+
else
1569+
Padding(padding: const EdgeInsets.only(bottom: 4))
15661570
])),
15671571
SizedBox(width: 16,
15681572
child: star),
@@ -1593,30 +1597,34 @@ class _EditMessageStatusRow extends StatelessWidget {
15931597

15941598
return switch (status) {
15951599
// TODO parse markdown and show new content as local echo?
1596-
false => Column(
1597-
crossAxisAlignment: CrossAxisAlignment.stretch,
1598-
spacing: 1.5,
1599-
children: [
1600-
Text(
1600+
false => Padding(
1601+
padding: const EdgeInsets.only(bottom: 4),
1602+
child: Column(
1603+
crossAxisAlignment: CrossAxisAlignment.stretch,
1604+
spacing: 1.5,
1605+
children: [
1606+
Text(
1607+
style: baseTextStyle
1608+
.copyWith(color: designVariables.btnLabelAttLowIntInfo),
1609+
textAlign: TextAlign.end,
1610+
zulipLocalizations.savingMessageEditLabel),
1611+
// TODO instead place within bottom outer padding:
1612+
// https://github.com/zulip/zulip-flutter/pull/1498#discussion_r2087576108
1613+
LinearProgressIndicator(
1614+
minHeight: 2,
1615+
color: designVariables.foreground.withValues(alpha: 0.5),
1616+
backgroundColor: designVariables.foreground.withValues(alpha: 0.2),
1617+
),
1618+
])),
1619+
true => Padding(
1620+
padding: const EdgeInsets.only(bottom: 4),
1621+
child: _RestoreEditMessageGestureDetector(
1622+
messageId: messageId,
1623+
child: Text(
16011624
style: baseTextStyle
1602-
.copyWith(color: designVariables.btnLabelAttLowIntInfo),
1625+
.copyWith(color: designVariables.btnLabelAttLowIntDanger),
16031626
textAlign: TextAlign.end,
1604-
zulipLocalizations.savingMessageEditLabel),
1605-
// TODO instead place within bottom outer padding:
1606-
// https://github.com/zulip/zulip-flutter/pull/1498#discussion_r2087576108
1607-
LinearProgressIndicator(
1608-
minHeight: 2,
1609-
color: designVariables.foreground.withValues(alpha: 0.5),
1610-
backgroundColor: designVariables.foreground.withValues(alpha: 0.2),
1611-
),
1612-
]),
1613-
true => _RestoreEditMessageGestureDetector(
1614-
messageId: messageId,
1615-
child: Text(
1616-
style: baseTextStyle
1617-
.copyWith(color: designVariables.btnLabelAttLowIntDanger),
1618-
textAlign: TextAlign.end,
1619-
zulipLocalizations.savingMessageEditFailedLabel)),
1627+
zulipLocalizations.savingMessageEditFailedLabel))),
16201628
};
16211629
}
16221630
}

0 commit comments

Comments
 (0)