@@ -22,7 +22,6 @@ import 'page.dart';
2222import 'profile.dart' ;
2323import 'sticky_header.dart' ;
2424import 'store.dart' ;
25- import 'edit_state_marker.dart' ;
2625import 'text.dart' ;
2726import 'theme.dart' ;
2827
@@ -33,7 +32,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
3332 dateSeparator: Colors .black,
3433 dateSeparatorText: const HSLColor .fromAHSL (0.75 , 0 , 0 , 0.15 ).toColor (),
3534 dmRecipientHeaderBg: const HSLColor .fromAHSL (1 , 46 , 0.35 , 0.93 ).toColor (),
36- editedMovedMarkerCollapsed : const Color . fromARGB ( 128 , 146 , 167 , 182 ),
35+ editedMovedLabel : Colors .black. withOpacity ( 0.35 ),
3736 messageTimestamp: const HSLColor .fromAHSL (0.8 , 0 , 0 , 0.2 ).toColor (),
3837 recipientHeaderText: const HSLColor .fromAHSL (1 , 0 , 0 , 0.15 ).toColor (),
3938 senderBotIcon: const HSLColor .fromAHSL (1 , 180 , 0.08 , 0.65 ).toColor (),
@@ -60,8 +59,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
6059 dateSeparator: Colors .white,
6160 dateSeparatorText: const HSLColor .fromAHSL (0.75 , 0 , 0 , 1 ).toColor (),
6261 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+ editedMovedLabel: Colors .white.withOpacity (0.35 ),
6563 messageTimestamp: const HSLColor .fromAHSL (0.6 , 0 , 0 , 1 ).toColor (),
6664 recipientHeaderText: const HSLColor .fromAHSL (0.8 , 0 , 0 , 1 ).toColor (),
6765 senderBotIcon: const HSLColor .fromAHSL (1 , 180 , 0.05 , 0.5 ).toColor (),
@@ -86,7 +84,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
8684 required this .dateSeparator,
8785 required this .dateSeparatorText,
8886 required this .dmRecipientHeaderBg,
89- required this .editedMovedMarkerCollapsed ,
87+ required this .editedMovedLabel ,
9088 required this .messageTimestamp,
9189 required this .recipientHeaderText,
9290 required this .senderBotIcon,
@@ -111,7 +109,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
111109 final Color dateSeparator;
112110 final Color dateSeparatorText;
113111 final Color dmRecipientHeaderBg;
114- final Color editedMovedMarkerCollapsed ;
112+ final Color editedMovedLabel ;
115113 final Color messageTimestamp;
116114 final Color recipientHeaderText;
117115 final Color senderBotIcon;
@@ -127,7 +125,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
127125 Color ? dateSeparator,
128126 Color ? dateSeparatorText,
129127 Color ? dmRecipientHeaderBg,
130- Color ? editedMovedMarkerCollapsed ,
128+ Color ? editedMovedLabel ,
131129 Color ? messageTimestamp,
132130 Color ? recipientHeaderText,
133131 Color ? senderBotIcon,
@@ -142,7 +140,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
142140 dateSeparator: dateSeparator ?? this .dateSeparator,
143141 dateSeparatorText: dateSeparatorText ?? this .dateSeparatorText,
144142 dmRecipientHeaderBg: dmRecipientHeaderBg ?? this .dmRecipientHeaderBg,
145- editedMovedMarkerCollapsed : editedMovedMarkerCollapsed ?? this .editedMovedMarkerCollapsed ,
143+ editedMovedLabel : editedMovedLabel ?? this .editedMovedLabel ,
146144 messageTimestamp: messageTimestamp ?? this .messageTimestamp,
147145 recipientHeaderText: recipientHeaderText ?? this .recipientHeaderText,
148146 senderBotIcon: senderBotIcon ?? this .senderBotIcon,
@@ -164,7 +162,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
164162 dateSeparator: Color .lerp (dateSeparator, other.dateSeparator, t)! ,
165163 dateSeparatorText: Color .lerp (dateSeparatorText, other.dateSeparatorText, t)! ,
166164 dmRecipientHeaderBg: Color .lerp (streamMessageBgDefault, other.dmRecipientHeaderBg, t)! ,
167- editedMovedMarkerCollapsed : Color .lerp (editedMovedMarkerCollapsed , other.editedMovedMarkerCollapsed , t)! ,
165+ editedMovedLabel : Color .lerp (editedMovedLabel , other.editedMovedLabel , t)! ,
168166 messageTimestamp: Color .lerp (messageTimestamp, other.messageTimestamp, t)! ,
169167 recipientHeaderText: Color .lerp (recipientHeaderText, other.recipientHeaderText, t)! ,
170168 senderBotIcon: Color .lerp (senderBotIcon, other.senderBotIcon, t)! ,
@@ -1253,6 +1251,29 @@ class MessageWithPossibleSender extends StatelessWidget {
12531251 ]);
12541252 }
12551253
1254+ Widget ? editStateRow;
1255+ if (message.editState != MessageEditState .none) {
1256+ final localizations = ZulipLocalizations .of (context);
1257+ final String editStateText;
1258+ switch (message.editState) {
1259+ case MessageEditState .edited:
1260+ editStateText = localizations.messageIsEditedLabel;
1261+ case MessageEditState .moved:
1262+ editStateText = localizations.messageIsMovedLabel;
1263+ case MessageEditState .none:
1264+ editStateText = '' ;
1265+ assert (false );
1266+ }
1267+ editStateRow = Text (editStateText,
1268+ textAlign: TextAlign .end,
1269+ style: TextStyle (
1270+ color: messageListTheme.editedMovedLabel,
1271+ fontFamily: 'Source Sans 3' ,
1272+ fontSize: 12 ,
1273+ height: (12 / 12 ),
1274+ ));
1275+ }
1276+
12561277 return GestureDetector (
12571278 behavior: HitTestBehavior .translucent,
12581279 onLongPress: () => showMessageActionSheet (context: context, message: message),
@@ -1262,21 +1283,27 @@ class MessageWithPossibleSender extends StatelessWidget {
12621283 if (senderRow != null )
12631284 Padding (padding: const EdgeInsets .fromLTRB (16 , 2 , 16 , 0 ),
12641285 child: senderRow),
1265- EditStateMarker (
1266- editState: message.editState,
1286+ Row (
1287+ crossAxisAlignment: CrossAxisAlignment .baseline,
1288+ textBaseline: localizedTextBaseline (context),
12671289 children: [
1268- Expanded (child: Column (
1269- crossAxisAlignment: CrossAxisAlignment .stretch,
1270- children: [
1271- MessageContent (message: message, content: item.content),
1272- if ((message.reactions? .total ?? 0 ) > 0 )
1273- ReactionChipsList (messageId: message.id, reactions: message.reactions! )
1274- ])),
1290+ const SizedBox (width: 16 ),
1291+ Expanded (
1292+ child: Column (
1293+ crossAxisAlignment: CrossAxisAlignment .stretch,
1294+ children: [
1295+ MessageContent (message: message, content: item.content),
1296+ if ((message.reactions? .total ?? 0 ) > 0 )
1297+ ReactionChipsList (messageId: message.id, reactions: message.reactions! ),
1298+ if (editStateRow != null )
1299+ editStateRow,
1300+ ]),
1301+ ),
12751302 SizedBox (width: 16 ,
12761303 child: message.flags.contains (MessageFlag .starred)
12771304 ? Icon (ZulipIcons .star_filled, size: 16 , color: designVariables.star)
12781305 : null ),
1279- ]),
1306+ ]),
12801307 ])));
12811308 }
12821309}
0 commit comments