Skip to content

Commit ba2ff4f

Browse files
PIG208chrisbobbe
authored andcommitted
msglist: Put edit-message progress bar in top half of 4px bottom padding
This is where the progress bar for outbox messages will go, so this is for consistency with that. Discussion: zulip#1453 (comment)
1 parent 69060bd commit ba2ff4f

File tree

1 file changed

+38
-34
lines changed

1 file changed

+38
-34
lines changed

lib/widgets/message_list.dart

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,7 +1528,7 @@ class MessageWithPossibleSender extends StatelessWidget {
15281528
behavior: HitTestBehavior.translucent,
15291529
onLongPress: () => showMessageActionSheet(context: context, message: message),
15301530
child: Padding(
1531-
padding: const EdgeInsets.symmetric(vertical: 4),
1531+
padding: const EdgeInsets.only(top: 4),
15321532
child: Column(children: [
15331533
if (item.showSender)
15341534
_SenderRow(message: message, showTimestamp: true),
@@ -1546,14 +1546,17 @@ class MessageWithPossibleSender extends StatelessWidget {
15461546
if (editMessageErrorStatus != null)
15471547
_EditMessageStatusRow(messageId: message.id, status: editMessageErrorStatus)
15481548
else if (editStateText != null)
1549-
Text(editStateText,
1550-
textAlign: TextAlign.end,
1551-
style: TextStyle(
1552-
color: designVariables.labelEdited,
1553-
fontSize: 12,
1554-
height: (12 / 12),
1555-
letterSpacing: proportionalLetterSpacing(
1556-
context, 0.05, baseFontSize: 12))),
1549+
Padding(padding: const EdgeInsets.only(bottom: 4),
1550+
child: Text(editStateText,
1551+
textAlign: TextAlign.end,
1552+
style: TextStyle(
1553+
color: designVariables.labelEdited,
1554+
fontSize: 12,
1555+
height: (12 / 12),
1556+
letterSpacing: proportionalLetterSpacing(context,
1557+
0.05, baseFontSize: 12))))
1558+
else
1559+
Padding(padding: const EdgeInsets.only(bottom: 4))
15571560
])),
15581561
SizedBox(width: 16,
15591562
child: star),
@@ -1582,33 +1585,34 @@ class _EditMessageStatusRow extends StatelessWidget {
15821585
letterSpacing: proportionalLetterSpacing(context,
15831586
0.05, baseFontSize: 12));
15841587

1585-
return switch (status) {
1586-
// TODO parse markdown and show new content as local echo?
1587-
false => Column(
1588-
crossAxisAlignment: CrossAxisAlignment.stretch,
1589-
spacing: 1.5,
1590-
children: [
1591-
Text(
1588+
return Padding(padding: EdgeInsets.only(bottom: 2),
1589+
child: switch (status) {
1590+
// TODO parse markdown and show new content as local echo?
1591+
false => Column(
1592+
crossAxisAlignment: CrossAxisAlignment.stretch,
1593+
spacing: 1.5,
1594+
children: [
1595+
Text(
1596+
style: baseTextStyle
1597+
.copyWith(color: designVariables.btnLabelAttLowIntInfo),
1598+
textAlign: TextAlign.end,
1599+
zulipLocalizations.savingMessageEditLabel),
1600+
// TODO instead place within bottom outer padding:
1601+
// https://github.com/zulip/zulip-flutter/pull/1498#discussion_r2087576108
1602+
LinearProgressIndicator(
1603+
minHeight: 2,
1604+
color: designVariables.foreground.withValues(alpha: 0.5),
1605+
backgroundColor: designVariables.foreground.withValues(alpha: 0.2),
1606+
),
1607+
]),
1608+
true => _RestoreEditMessageGestureDetector(
1609+
messageId: messageId,
1610+
child: Text(
15921611
style: baseTextStyle
1593-
.copyWith(color: designVariables.btnLabelAttLowIntInfo),
1612+
.copyWith(color: designVariables.btnLabelAttLowIntDanger),
15941613
textAlign: TextAlign.end,
1595-
zulipLocalizations.savingMessageEditLabel),
1596-
// TODO instead place within bottom outer padding:
1597-
// https://github.com/zulip/zulip-flutter/pull/1498#discussion_r2087576108
1598-
LinearProgressIndicator(
1599-
minHeight: 2,
1600-
color: designVariables.foreground.withValues(alpha: 0.5),
1601-
backgroundColor: designVariables.foreground.withValues(alpha: 0.2),
1602-
),
1603-
]),
1604-
true => _RestoreEditMessageGestureDetector(
1605-
messageId: messageId,
1606-
child: Text(
1607-
style: baseTextStyle
1608-
.copyWith(color: designVariables.btnLabelAttLowIntDanger),
1609-
textAlign: TextAlign.end,
1610-
zulipLocalizations.savingMessageEditFailedLabel)),
1611-
};
1614+
zulipLocalizations.savingMessageEditFailedLabel)),
1615+
});
16121616
}
16131617
}
16141618

0 commit comments

Comments
 (0)