@@ -22,7 +22,6 @@ import 'page.dart';
22
22
import 'profile.dart' ;
23
23
import 'sticky_header.dart' ;
24
24
import 'store.dart' ;
25
- import 'edit_state_marker.dart' ;
26
25
import 'text.dart' ;
27
26
import 'theme.dart' ;
28
27
@@ -33,7 +32,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
33
32
dateSeparator: Colors .black,
34
33
dateSeparatorText: const HSLColor .fromAHSL (0.75 , 0 , 0 , 0.15 ).toColor (),
35
34
dmRecipientHeaderBg: const HSLColor .fromAHSL (1 , 46 , 0.35 , 0.93 ).toColor (),
36
- editedMovedMarkerCollapsed : const Color . fromARGB ( 128 , 146 , 167 , 182 ),
35
+ editStateLabel : const HSLColor . fromAHSL ( 0.35 , 0 , 0 , 0 ). toColor ( ),
37
36
messageTimestamp: const HSLColor .fromAHSL (0.8 , 0 , 0 , 0.2 ).toColor (),
38
37
recipientHeaderText: const HSLColor .fromAHSL (1 , 0 , 0 , 0.15 ).toColor (),
39
38
senderBotIcon: const HSLColor .fromAHSL (1 , 180 , 0.08 , 0.65 ).toColor (),
@@ -60,8 +59,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
60
59
dateSeparator: Colors .white,
61
60
dateSeparatorText: const HSLColor .fromAHSL (0.75 , 0 , 0 , 1 ).toColor (),
62
61
dmRecipientHeaderBg: const HSLColor .fromAHSL (1 , 46 , 0.15 , 0.2 ).toColor (),
63
- // TODO(design-dark) need proper dark-theme color (this is ad hoc)
64
- editedMovedMarkerCollapsed: const Color .fromARGB (128 , 214 , 202 , 194 ),
62
+ editStateLabel: const HSLColor .fromAHSL (0.35 , 0 , 0 , 1 ).toColor (),
65
63
messageTimestamp: const HSLColor .fromAHSL (0.6 , 0 , 0 , 1 ).toColor (),
66
64
recipientHeaderText: const HSLColor .fromAHSL (0.8 , 0 , 0 , 1 ).toColor (),
67
65
senderBotIcon: const HSLColor .fromAHSL (1 , 180 , 0.05 , 0.5 ).toColor (),
@@ -86,7 +84,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
86
84
required this .dateSeparator,
87
85
required this .dateSeparatorText,
88
86
required this .dmRecipientHeaderBg,
89
- required this .editedMovedMarkerCollapsed ,
87
+ required this .editStateLabel ,
90
88
required this .messageTimestamp,
91
89
required this .recipientHeaderText,
92
90
required this .senderBotIcon,
@@ -111,7 +109,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
111
109
final Color dateSeparator;
112
110
final Color dateSeparatorText;
113
111
final Color dmRecipientHeaderBg;
114
- final Color editedMovedMarkerCollapsed ;
112
+ final Color editStateLabel ;
115
113
final Color messageTimestamp;
116
114
final Color recipientHeaderText;
117
115
final Color senderBotIcon;
@@ -127,7 +125,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
127
125
Color ? dateSeparator,
128
126
Color ? dateSeparatorText,
129
127
Color ? dmRecipientHeaderBg,
130
- Color ? editedMovedMarkerCollapsed ,
128
+ Color ? editStateLabel ,
131
129
Color ? messageTimestamp,
132
130
Color ? recipientHeaderText,
133
131
Color ? senderBotIcon,
@@ -142,7 +140,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
142
140
dateSeparator: dateSeparator ?? this .dateSeparator,
143
141
dateSeparatorText: dateSeparatorText ?? this .dateSeparatorText,
144
142
dmRecipientHeaderBg: dmRecipientHeaderBg ?? this .dmRecipientHeaderBg,
145
- editedMovedMarkerCollapsed : editedMovedMarkerCollapsed ?? this .editedMovedMarkerCollapsed ,
143
+ editStateLabel : editStateLabel ?? this .editStateLabel ,
146
144
messageTimestamp: messageTimestamp ?? this .messageTimestamp,
147
145
recipientHeaderText: recipientHeaderText ?? this .recipientHeaderText,
148
146
senderBotIcon: senderBotIcon ?? this .senderBotIcon,
@@ -164,7 +162,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
164
162
dateSeparator: Color .lerp (dateSeparator, other.dateSeparator, t)! ,
165
163
dateSeparatorText: Color .lerp (dateSeparatorText, other.dateSeparatorText, t)! ,
166
164
dmRecipientHeaderBg: Color .lerp (streamMessageBgDefault, other.dmRecipientHeaderBg, t)! ,
167
- editedMovedMarkerCollapsed : Color .lerp (editedMovedMarkerCollapsed , other.editedMovedMarkerCollapsed , t)! ,
165
+ editStateLabel : Color .lerp (editStateLabel , other.editStateLabel , t)! ,
168
166
messageTimestamp: Color .lerp (messageTimestamp, other.messageTimestamp, t)! ,
169
167
recipientHeaderText: Color .lerp (recipientHeaderText, other.recipientHeaderText, t)! ,
170
168
senderBotIcon: Color .lerp (senderBotIcon, other.senderBotIcon, t)! ,
@@ -1256,6 +1254,16 @@ class MessageWithPossibleSender extends StatelessWidget {
1256
1254
]);
1257
1255
}
1258
1256
1257
+ final localizations = ZulipLocalizations .of (context);
1258
+ String ? editStateText;
1259
+ switch (message.editState) {
1260
+ case MessageEditState .edited:
1261
+ editStateText = localizations.messageIsEditedLabel;
1262
+ case MessageEditState .moved:
1263
+ editStateText = localizations.messageIsMovedLabel;
1264
+ case MessageEditState .none:
1265
+ }
1266
+
1259
1267
return GestureDetector (
1260
1268
behavior: HitTestBehavior .translucent,
1261
1269
onLongPress: () => showMessageActionSheet (context: context, message: message),
@@ -1265,15 +1273,25 @@ class MessageWithPossibleSender extends StatelessWidget {
1265
1273
if (senderRow != null )
1266
1274
Padding (padding: const EdgeInsets .fromLTRB (16 , 2 , 16 , 0 ),
1267
1275
child: senderRow),
1268
- EditStateMarker (
1269
- editState: message.editState,
1276
+ Row (
1277
+ crossAxisAlignment: CrossAxisAlignment .baseline,
1278
+ textBaseline: localizedTextBaseline (context),
1270
1279
children: [
1280
+ const SizedBox (width: 16 ),
1271
1281
Expanded (child: Column (
1272
1282
crossAxisAlignment: CrossAxisAlignment .stretch,
1273
1283
children: [
1274
1284
MessageContent (message: message, content: item.content),
1285
+ if (editStateText != null )
1286
+ Text (editStateText, textAlign: TextAlign .end,
1287
+ style: TextStyle (
1288
+ color: designVariables.labelEdited,
1289
+ fontSize: 12 ,
1290
+ height: (12 / 12 ),
1291
+ letterSpacing: proportionalLetterSpacing (
1292
+ context, 0.05 , baseFontSize: 12 ))),
1275
1293
if ((message.reactions? .total ?? 0 ) > 0 )
1276
- ReactionChipsList (messageId: message.id, reactions: message.reactions! )
1294
+ ReactionChipsList (messageId: message.id, reactions: message.reactions! ),
1277
1295
])),
1278
1296
SizedBox (width: 16 ,
1279
1297
child: message.flags.contains (MessageFlag .starred)
0 commit comments