mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
get rid of .setBlockFormat(..) in ChatAreaWidget::insertMessage(..) function
This commit is contained in:
parent
2aff9fde5c
commit
968b46a86b
|
@ -44,10 +44,10 @@ ChatAreaWidget::ChatAreaWidget(QWidget *parent) :
|
|||
chatTextTable->format().setCellSpacing(2);
|
||||
chatTextTable->format().setWidth(QTextLength(QTextLength::PercentageLength,100));
|
||||
|
||||
nameFormat.setAlignment(Qt::AlignRight);
|
||||
nameFormat.setNonBreakableLines(true);
|
||||
dateFormat.setAlignment(Qt::AlignLeft);
|
||||
dateFormat.setNonBreakableLines(true);
|
||||
// nameFormat.setAlignment(Qt::AlignRight);
|
||||
// nameFormat.setNonBreakableLines(true);
|
||||
// dateFormat.setAlignment(Qt::AlignLeft);
|
||||
// dateFormat.setNonBreakableLines(true);
|
||||
|
||||
connect(this, &ChatAreaWidget::anchorClicked, this, &ChatAreaWidget::onAnchorClicked);
|
||||
connect(verticalScrollBar(), SIGNAL(rangeChanged(int,int)), this, SLOT(onSliderRangeChanged()));
|
||||
|
@ -104,8 +104,8 @@ void ChatAreaWidget::insertMessage(ChatAction *msgAction)
|
|||
checkSlider();
|
||||
|
||||
int row = chatTextTable->rows() - 1;
|
||||
chatTextTable->cellAt(row,0).firstCursorPosition().setBlockFormat(nameFormat);
|
||||
chatTextTable->cellAt(row,2).firstCursorPosition().setBlockFormat(dateFormat);
|
||||
// chatTextTable->cellAt(row,0).firstCursorPosition().setBlockFormat(nameFormat);
|
||||
// chatTextTable->cellAt(row,2).firstCursorPosition().setBlockFormat(dateFormat);
|
||||
QTextCursor cur = chatTextTable->cellAt(row,1).firstCursorPosition();
|
||||
cur.clearSelection();
|
||||
cur.setKeepPositionOnInsert(true);
|
||||
|
|
|
@ -43,9 +43,9 @@ QString ChatAction::QImage2base64(const QImage &img)
|
|||
QString ChatAction::getName()
|
||||
{
|
||||
if (isMe)
|
||||
return QString("<div class=name_me>" + toHtmlChars(name) + "</div>");
|
||||
return QString("<table width=100% cellspacing=0><tr><td align=right><div class=name_me>" + toHtmlChars(name) + "</div></td></tr></table>");
|
||||
else
|
||||
return QString("<div class=name>" + toHtmlChars(name) + "</div>");
|
||||
return QString("<table width=100% cellspacing=0><tr><td align=right><div class=name>" + toHtmlChars(name) + "</div></td></tr></table>");
|
||||
}
|
||||
|
||||
QString ChatAction::getDate()
|
||||
|
|
Loading…
Reference in New Issue
Block a user