mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-04-26 13:08:02 +00:00
ios: avoid message changing width when sent/received ticks appear (#4945)
This commit is contained in:
@@ -75,9 +75,14 @@ enum MetaColorMode {
|
||||
}
|
||||
}
|
||||
|
||||
var statusSpacer: Text {
|
||||
func statusSpacer(_ sent: Bool) -> Text {
|
||||
switch self {
|
||||
case .normal, .transparent: Text(Image(systemName: "circlebadge.fill")).foregroundColor(.clear)
|
||||
case .normal, .transparent:
|
||||
Text(
|
||||
sent
|
||||
? Image("checkmark.wide")
|
||||
: Image(systemName: "circlebadge.fill")
|
||||
).foregroundColor(.clear)
|
||||
case .invertedMaterial: Text(" ").kerning(13)
|
||||
}
|
||||
}
|
||||
@@ -130,10 +135,10 @@ func ciMetaText(
|
||||
colorMode.resolve(statusColor)
|
||||
}
|
||||
r = r + colored(Text(image), metaColor)
|
||||
space = Text(" ")
|
||||
} else if !meta.disappearing {
|
||||
space = colorMode.statusSpacer + Text(" ")
|
||||
r = r + colorMode.statusSpacer(meta.itemStatus.sent)
|
||||
}
|
||||
space = Text(" ")
|
||||
}
|
||||
if let enc = encrypted {
|
||||
appendSpace()
|
||||
|
||||
@@ -2820,6 +2820,20 @@ public enum CIStatus: Decodable, Hashable {
|
||||
case .invalid: return "invalid"
|
||||
}
|
||||
}
|
||||
|
||||
public var sent: Bool {
|
||||
switch self {
|
||||
case .sndNew: true
|
||||
case .sndSent: true
|
||||
case .sndRcvd: true
|
||||
case .sndErrorAuth: true
|
||||
case .sndError: true
|
||||
case .sndWarning: true
|
||||
case .rcvNew: false
|
||||
case .rcvRead: false
|
||||
case .invalid: false
|
||||
}
|
||||
}
|
||||
|
||||
public func statusIcon(_ metaColor: Color, _ paleMetaColor: Color, _ primaryColor: Color = .accentColor) -> (Image, Color)? {
|
||||
switch self {
|
||||
|
||||
Reference in New Issue
Block a user