mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-26 23:36:59 -05:00
Fix spaces between emoticons in message composer and forum
This commit is contained in:
parent
d0ab10cc38
commit
d1328f4467
@ -400,7 +400,13 @@ void CreateGxsForumMsg::smileyWidgetForums()
|
||||
|
||||
void CreateGxsForumMsg::addSmileys()
|
||||
{
|
||||
ui.forumMessage->textCursor().insertText(qobject_cast<QPushButton*>(sender())->toolTip().split("|").first());
|
||||
QString smiley = qobject_cast<QPushButton*>(sender())->toolTip().split("|").first();
|
||||
// add trailing space
|
||||
smiley += QString(" ");
|
||||
// add preceding space when needed (not at start of text or preceding space already exists)
|
||||
if(!ui.forumMessage->textCursor().atStart() && ui.forumMessage->toPlainText()[ui.forumMessage->textCursor().position() - 1] != QChar(' '))
|
||||
smiley = QString(" ") + smiley;
|
||||
ui.forumMessage->textCursor().insertText(smiley);
|
||||
}
|
||||
|
||||
void CreateGxsForumMsg::addFile()
|
||||
|
@ -2200,7 +2200,13 @@ void MessageComposer::smileyWidget()
|
||||
|
||||
void MessageComposer::addSmileys()
|
||||
{
|
||||
ui.msgText->textCursor().insertText(qobject_cast<QPushButton*>(sender())->toolTip().split("|").first());
|
||||
QString smiley = qobject_cast<QPushButton*>(sender())->toolTip().split("|").first();
|
||||
// add trailing space
|
||||
smiley += QString(" ");
|
||||
// add preceding space when needed (not at start of text or preceding space already exists)
|
||||
if(!ui.msgText->textCursor().atStart() && ui.msgText->toPlainText()[ui.msgText->textCursor().position() - 1] != QChar(' '))
|
||||
smiley = QString(" ") + smiley;
|
||||
ui.msgText->textCursor().insertText(smiley);
|
||||
}
|
||||
|
||||
void MessageComposer::currentCharFormatChanged(const QTextCharFormat &format)
|
||||
|
Loading…
x
Reference in New Issue
Block a user