Skip to content

Commit 44c75d2

Browse files
committed
star: Align the icon with message content.
By wrapping the icon with a dummy Text widget in a Row, the Text helps us stretch the row to the same height as a line of a message content would have. This allows us to position the icon with respect to text, even if a scaling factor has been applied. Fixes #616. Signed-off-by: Zixuan James Li <[email protected]>
1 parent 7fb60a8 commit 44c75d2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/widgets/edit_state_marker.dart

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ class _SwipableMessageRowState extends State<SwipableMessageRow> {
2525
Widget build(BuildContext context) {
2626
final theme = Theme.of(context).extension<DesignVariables>()!;
2727

28-
// TODO(#157): fix how star marker aligns with message content
29-
// Design from Figma at:
30-
// https://www.figma.com/file/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=813%3A28817&mode=dev .
31-
var star = Padding(padding: const EdgeInsets.only(top: 5.5),
32-
child: Icon(ZulipIcons.star_filled, size: 16, color: theme.starColor));
28+
var star = Padding(
29+
padding: const EdgeInsets.only(top: 5.5),
30+
child: Row(children: [
31+
const Text("", style: TextStyle(fontSize: 15)),
32+
Icon(ZulipIcons.star_filled, size: 16, color: theme.starColor)]));
3333
final hasMarker = widget.message.editState != MessageEditState.none;
3434

3535
return Stack(

0 commit comments

Comments
 (0)