Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class PaddedTextField: CCTextField {
paddedCell.placeholderString = existingCell.placeholderString
paddedCell.lineBreakMode = existingCell.lineBreakMode
paddedCell.truncatesLastVisibleLine = existingCell.truncatesLastVisibleLine
paddedCell.wraps = existingCell.wraps
}

self.cell = paddedCell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ extension NewMessageCollectionViewItem {
func setupViews() {
messageLabel.setSelectionColor(color: NSColor.getTextSelectionColor())
messageLabel.allowsEditingTextAttributes = true
messageLabel.maximumNumberOfLines = 0
messageLabel.cell?.wraps = true

receivedArrow.drawReceivedBubbleArrow(color: NSColor.Sphinx.ReceivedMsgBG)
sentArrow.drawSentBubbleArrow(color: NSColor.Sphinx.SentMsgBG)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,17 @@ extension NewOnlyTextMessageCollectionViewitem {

func configureWith(
messageContent: BubbleMessageLayoutState.MessageContent?,
searchingTerm: String?
messageCellState: MessageTableCellState,
searchingTerm: String?,
collectionViewWidth: CGFloat
) {
let labelHeight = ChatHelper.getTextMessageHeightFor(
messageCellState,
collectionViewWidth: collectionViewWidth
)
labelHeightConstraint.constant = labelHeight
textMessageView.superview?.layoutSubtreeIfNeeded()

if let messageContent = messageContent {
if messageContent.hasNoMarkdown && searchingTerm == nil {
messageLabel.attributedStringValue = NSMutableAttributedString(string: "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class NewOnlyTextMessageCollectionViewitem: CommonNewMessageCollectionViewitem,

///Constraints
@IBOutlet weak var bubbleWidthConstraint: NSLayoutConstraint!
@IBOutlet weak var labelHeightConstraint: NSLayoutConstraint!

///Thirs Container
@IBOutlet weak var textMessageView: NSView!
Expand Down Expand Up @@ -52,6 +53,8 @@ class NewOnlyTextMessageCollectionViewitem: CommonNewMessageCollectionViewitem,

messageLabel.setSelectionColor(color: NSColor.getTextSelectionColor())
messageLabel.allowsEditingTextAttributes = true
messageLabel.maximumNumberOfLines = 0
messageLabel.cell?.wraps = true

let lineFrame = CGRect(
x: 0.0,
Expand Down Expand Up @@ -106,7 +109,9 @@ class NewOnlyTextMessageCollectionViewitem: CommonNewMessageCollectionViewitem,
///Text message content
configureWith(
messageContent: mutableMessageCellState.messageContent,
searchingTerm: searchingTerm
messageCellState: mutableMessageCellState,
searchingTerm: searchingTerm,
collectionViewWidth: collectionViewWidth
)

///Header and avatar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
<constraint firstItem="7nT-GT-4h9" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="d54-Qo-HA4" secondAttribute="leading" id="rR7-3W-nxf"/>
<constraint firstItem="7nT-GT-4h9" firstAttribute="leading" secondItem="d54-Qo-HA4" secondAttribute="leading" id="w2g-8z-QSW"/>
<constraint firstAttribute="trailing" secondItem="7nT-GT-4h9" secondAttribute="trailing" id="zAt-KU-ECV"/>
<constraint firstAttribute="height" constant="48" id="hJB-h5-cNj-only"/>
</constraints>
</customView>
</subviews>
Expand Down Expand Up @@ -261,6 +262,7 @@
<outlet property="sentMessageMenuButton" destination="RqW-7V-PIs" id="2bU-AU-QHf"/>
<outlet property="statusHeaderView" destination="pCr-jf-cNZ" id="cWy-hb-E5V"/>
<outlet property="statusHeaderViewContainer" destination="9rC-bS-7Ll" id="6WL-tm-vMv"/>
<outlet property="labelHeightConstraint" destination="hJB-h5-cNj-only" id="lHC-on-ly1"/>
<outlet property="textMessageView" destination="d54-Qo-HA4" id="yRC-tJ-VmA"/>
<outlet property="view" destination="Hz6-mo-xeY" id="BkZ-7O-Bm8"/>
</connections>
Expand Down