|
|
@ -5,7 +5,7 @@
|
|
|
|
import Foundation
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
|
|
|
|
@objc
|
|
|
|
@objc
|
|
|
|
public class OWSTextInsets: NSObject {
|
|
|
|
public class OWSDirectionalEdgeInsets: NSObject {
|
|
|
|
|
|
|
|
|
|
|
|
@objc public let leading: CGFloat
|
|
|
|
@objc public let leading: CGFloat
|
|
|
|
@objc public let trailing: CGFloat
|
|
|
|
@objc public let trailing: CGFloat
|
|
|
@ -13,10 +13,10 @@ public class OWSTextInsets: NSObject {
|
|
|
|
@objc public let bottom: CGFloat
|
|
|
|
@objc public let bottom: CGFloat
|
|
|
|
|
|
|
|
|
|
|
|
@objc
|
|
|
|
@objc
|
|
|
|
public required init(leading: CGFloat = 0,
|
|
|
|
public required init(top: CGFloat = 0,
|
|
|
|
trailing: CGFloat = 0,
|
|
|
|
leading: CGFloat = 0,
|
|
|
|
top: CGFloat = 0,
|
|
|
|
bottom: CGFloat = 0,
|
|
|
|
bottom: CGFloat = 0) {
|
|
|
|
trailing: CGFloat = 0) {
|
|
|
|
|
|
|
|
|
|
|
|
self.leading = leading
|
|
|
|
self.leading = leading
|
|
|
|
self.trailing = trailing
|
|
|
|
self.trailing = trailing
|
|
|
@ -63,7 +63,7 @@ public class ConversationLayoutInfo: NSObject {
|
|
|
|
@objc public var maxMessageWidth: CGFloat = 0
|
|
|
|
@objc public var maxMessageWidth: CGFloat = 0
|
|
|
|
@objc public var maxFooterWidth: CGFloat = 0
|
|
|
|
@objc public var maxFooterWidth: CGFloat = 0
|
|
|
|
|
|
|
|
|
|
|
|
@objc public var textInsets = OWSTextInsets()
|
|
|
|
@objc public var textInsets = OWSDirectionalEdgeInsets()
|
|
|
|
|
|
|
|
|
|
|
|
@objc
|
|
|
|
@objc
|
|
|
|
public required init(thread: TSThread) {
|
|
|
|
public required init(thread: TSThread) {
|
|
|
@ -122,9 +122,9 @@ public class ConversationLayoutInfo: NSObject {
|
|
|
|
// negative value.
|
|
|
|
// negative value.
|
|
|
|
let textInsetBottom = max(0, 12 - abs(messageTextFont.descender))
|
|
|
|
let textInsetBottom = max(0, 12 - abs(messageTextFont.descender))
|
|
|
|
|
|
|
|
|
|
|
|
textInsets = OWSTextInsets(leading: 12,
|
|
|
|
textInsets = OWSDirectionalEdgeInsets(top: textInsetTop,
|
|
|
|
trailing: 12,
|
|
|
|
leading: 12,
|
|
|
|
top: textInsetTop,
|
|
|
|
bottom: textInsetBottom,
|
|
|
|
bottom: textInsetBottom)
|
|
|
|
trailing: 12)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|