mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-04 23:25:32 -04:00
Added modified patch from AC
- don't remove color and font when the last char is deleted from the chat text entry box git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5095 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
722bade918
commit
f2f5d60a8a
4 changed files with 44 additions and 4 deletions
|
@ -61,6 +61,7 @@ ChatWidget::ChatWidget(QWidget *parent) :
|
|||
peerStatus = 0;
|
||||
isChatLobby = false;
|
||||
firstShow = true;
|
||||
inChatCharFormatChanged = false;
|
||||
|
||||
lastStatusSendTime = 0 ;
|
||||
|
||||
|
@ -86,6 +87,8 @@ ChatWidget::ChatWidget(QWidget *parent) :
|
|||
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewCustomStateString(const QString&, const QString&)), this, SLOT(updatePeersCustomStateString(const QString&, const QString&)));
|
||||
|
||||
connect(ui->chattextEdit, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenu(QPoint)));
|
||||
// reset text and color after removing all characters from the QTextEdit and after calling QTextEdit::clear
|
||||
connect(ui->chattextEdit, SIGNAL(currentCharFormatChanged(QTextCharFormat)), this, SLOT(chatCharFormatChanged()));
|
||||
|
||||
ui->infoframe->setVisible(false);
|
||||
ui->statusmessagelabel->hide();
|
||||
|
@ -368,6 +371,23 @@ void ChatWidget::contextMenu(QPoint /*point*/)
|
|||
delete(contextMnu);
|
||||
}
|
||||
|
||||
void ChatWidget::chatCharFormatChanged()
|
||||
{
|
||||
if (inChatCharFormatChanged) {
|
||||
return;
|
||||
}
|
||||
|
||||
inChatCharFormatChanged = true;
|
||||
|
||||
// Reset font and color before inserting a character if edit box is empty
|
||||
// (color info disappears when the user deletes all text)
|
||||
if (ui->chattextEdit->toPlainText().isEmpty()) {
|
||||
setColorAndFont();
|
||||
}
|
||||
|
||||
inChatCharFormatChanged = false;
|
||||
}
|
||||
|
||||
void ChatWidget::resetStatusBar()
|
||||
{
|
||||
ui->statusLabel->clear();
|
||||
|
@ -422,8 +442,6 @@ void ChatWidget::sendChat()
|
|||
// workaround for Qt bug - http://bugreports.qt.nokia.com/browse/QTBUG-2533
|
||||
// QTextEdit::clear() does not reset the CharFormat if document contains hyperlinks that have been accessed.
|
||||
chatWidget->setCurrentCharFormat(QTextCharFormat ());
|
||||
|
||||
setColorAndFont();
|
||||
}
|
||||
|
||||
void ChatWidget::on_closeInfoFrameButton_clicked()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue