From 2f99cd01c19f5931c6b8ccbd079c9cc49ebf4a8b Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Fri, 10 Jul 2020 10:13:18 -0500 Subject: [PATCH] Fix the width of the indicator so that it would stop reflowing the cell when changed to star --- .../Timeline/TimelineItemStatusView.swift | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/Multiplatform/Shared/Timeline/TimelineItemStatusView.swift b/Multiplatform/Shared/Timeline/TimelineItemStatusView.swift index 0db428879..8fb3b10f6 100644 --- a/Multiplatform/Shared/Timeline/TimelineItemStatusView.swift +++ b/Multiplatform/Shared/Timeline/TimelineItemStatusView.swift @@ -13,22 +13,25 @@ struct TimelineItemStatusView: View { var status: TimelineItemStatus @ViewBuilder var statusView: some View { - switch status { - case .showUnread: - AppAssets.timelineUnread - .resizable() - .frame(width: 8, height: 8, alignment: .center) - .padding(.all, 2) - case .showStar: - AppAssets.timelineStarred - .resizable() - .frame(width: 10, height: 10, alignment: .center) - case .showNone: - AppAssets.timelineUnread - .resizable() - .frame(width: 8, height: 8, alignment: .center) - .padding(.all, 2) - .opacity(0) + ZStack { + Spacer().frame(width: 12) + switch status { + case .showUnread: + AppAssets.timelineUnread + .resizable() + .frame(width: 8, height: 8, alignment: .center) + .padding(.all, 2) + case .showStar: + AppAssets.timelineStarred + .resizable() + .frame(width: 10, height: 10, alignment: .center) + case .showNone: + AppAssets.timelineUnread + .resizable() + .frame(width: 8, height: 8, alignment: .center) + .padding(.all, 2) + .opacity(0) + } } }