@@ -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)! ,
@@ -1253,6 +1251,16 @@ class MessageWithPossibleSender extends StatelessWidget {
1253
1251
]);
1254
1252
}
1255
1253
1254
+ final localizations = ZulipLocalizations .of (context);
1255
+ String ? editStateText;
1256
+ switch (message.editState) {
1257
+ case MessageEditState .edited:
1258
+ editStateText = localizations.messageIsEditedLabel;
1259
+ case MessageEditState .moved:
1260
+ editStateText = localizations.messageIsMovedLabel;
1261
+ case MessageEditState .none:
1262
+ }
1263
+
1256
1264
return GestureDetector (
1257
1265
behavior: HitTestBehavior .translucent,
1258
1266
onLongPress: () => showMessageActionSheet (context: context, message: message),
@@ -1262,15 +1270,24 @@ class MessageWithPossibleSender extends StatelessWidget {
1262
1270
if (senderRow != null )
1263
1271
Padding (padding: const EdgeInsets .fromLTRB (16 , 2 , 16 , 0 ),
1264
1272
child: senderRow),
1265
- EditStateMarker (
1266
- editState: message.editState,
1273
+ Row (
1274
+ crossAxisAlignment: CrossAxisAlignment .baseline,
1275
+ textBaseline: localizedTextBaseline (context),
1267
1276
children: [
1277
+ const SizedBox (width: 16 ),
1268
1278
Expanded (child: Column (
1269
1279
crossAxisAlignment: CrossAxisAlignment .stretch,
1270
1280
children: [
1271
1281
MessageContent (message: message, content: item.content),
1272
1282
if ((message.reactions? .total ?? 0 ) > 0 )
1273
- ReactionChipsList (messageId: message.id, reactions: message.reactions! )
1283
+ ReactionChipsList (messageId: message.id, reactions: message.reactions! ),
1284
+ if (editStateText != null )
1285
+ Text (editStateText, textAlign: TextAlign .end,
1286
+ style: TextStyle (
1287
+ color: messageListTheme.editStateLabel,
1288
+ fontFamily: 'Source Sans 3' ,
1289
+ fontSize: 12 ,
1290
+ height: (12 / 12 ))),
1274
1291
])),
1275
1292
SizedBox (width: 16 ,
1276
1293
child: message.flags.contains (MessageFlag .starred)
0 commit comments