mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
CR: proper width calculation for header view
This commit is contained in:
parent
f33e5c019c
commit
24060c17d0
2 changed files with 11 additions and 9 deletions
|
@ -170,7 +170,7 @@ const CGFloat OWSMessageHeaderViewDateHeaderVMargin = 23;
|
|||
CGFloat strokeThickness = [self strokeThicknessWithViewItem:viewItem];
|
||||
result.height += strokeThickness;
|
||||
|
||||
CGFloat maxTextWidth = conversationStyle.fullWidthContentWidth;
|
||||
CGFloat maxTextWidth = conversationStyle.headerViewContentWidth;
|
||||
CGSize titleSize = [self.titleLabel sizeThatFits:CGSizeMake(maxTextWidth, CGFLOAT_MAX)];
|
||||
result.height += titleSize.height + self.stackView.spacing;
|
||||
|
||||
|
|
|
@ -34,11 +34,17 @@ public class ConversationStyle: NSObject {
|
|||
|
||||
@objc public var errorGutterTrailing: CGFloat = 0
|
||||
|
||||
// viewWidth - (gutterLeading + gutterTrailing)
|
||||
@objc public var contentWidth: CGFloat = 0
|
||||
@objc public var contentWidth: CGFloat {
|
||||
return viewWidth - (gutterLeading + gutterTrailing)
|
||||
}
|
||||
|
||||
// viewWidth - (gutterfullWidthGutterLeadingLeading + fullWidthGutterTrailing)
|
||||
@objc public var fullWidthContentWidth: CGFloat = 0
|
||||
@objc public var fullWidthContentWidth: CGFloat {
|
||||
return viewWidth - (fullWidthGutterLeading + fullWidthGutterTrailing)
|
||||
}
|
||||
|
||||
@objc public var headerViewContentWidth: CGFloat {
|
||||
return viewWidth - (headerGutterLeading + headerGutterTrailing)
|
||||
}
|
||||
|
||||
@objc public var maxMessageWidth: CGFloat = 0
|
||||
|
||||
|
@ -97,10 +103,6 @@ public class ConversationStyle: NSObject {
|
|||
headerGutterTrailing = 28
|
||||
errorGutterTrailing = 16
|
||||
|
||||
contentWidth = viewWidth - (gutterLeading + gutterTrailing)
|
||||
|
||||
fullWidthContentWidth = viewWidth - (fullWidthGutterLeading + fullWidthGutterTrailing)
|
||||
|
||||
maxMessageWidth = floor(contentWidth - 32)
|
||||
|
||||
let messageTextFont = UIFont.ows_dynamicTypeBody
|
||||
|
|
Loading…
Reference in a new issue