mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-19 14:30:43 -04:00
Fix spaces between emoticons in message composer and forum
This commit is contained in:
parent
d0ab10cc38
commit
d1328f4467
2 changed files with 14 additions and 2 deletions
|
@ -400,7 +400,13 @@ void CreateGxsForumMsg::smileyWidgetForums()
|
||||||
|
|
||||||
void CreateGxsForumMsg::addSmileys()
|
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()
|
void CreateGxsForumMsg::addFile()
|
||||||
|
|
|
@ -2200,7 +2200,13 @@ void MessageComposer::smileyWidget()
|
||||||
|
|
||||||
void MessageComposer::addSmileys()
|
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)
|
void MessageComposer::currentCharFormatChanged(const QTextCharFormat &format)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue