Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 9868e37c authored by Laurent Montel's avatar Laurent Montel 😁

Allow to show or not plain text emoticon

parent d8d86ef9
......@@ -36,13 +36,17 @@ EmoticonUnicodeTab::~EmoticonUnicodeTab()
void EmoticonUnicodeTab::loadEmoticons()
{
createTab(i18n("Faces"), KPIMTextEdit::TextUtils::unicodeFacesEmoji());
createTab(i18n("Animals"), KPIMTextEdit::TextUtils::unicodeAnimalsEmoji());
createTab(i18n("Emotions"), KPIMTextEdit::TextUtils::unicodeEmotionEmoji());
createTab(i18n("Body"), KPIMTextEdit::TextUtils::unicodeBodyEmoji());
createTab(i18n("Transports"), KPIMTextEdit::TextUtils::unicodeTransportEmoji());
createTab(i18n("Events"), KPIMTextEdit::TextUtils::unicodeEventEmoji());
createTab(i18n("Flags"), KPIMTextEdit::TextUtils::unicodeFlagsEmoji());
if (mEmojiPlainText) {
createTab(i18n("Faces"), KPIMTextEdit::TextUtils::unicodeFacesEmoji());
createTab(i18n("Animals"), KPIMTextEdit::TextUtils::unicodeAnimalsEmoji());
createTab(i18n("Emotions"), KPIMTextEdit::TextUtils::unicodeEmotionEmoji());
createTab(i18n("Body"), KPIMTextEdit::TextUtils::unicodeBodyEmoji());
createTab(i18n("Transports"), KPIMTextEdit::TextUtils::unicodeTransportEmoji());
createTab(i18n("Events"), KPIMTextEdit::TextUtils::unicodeEventEmoji());
createTab(i18n("Flags"), KPIMTextEdit::TextUtils::unicodeFlagsEmoji());
} else {
//TODO
}
}
void EmoticonUnicodeTab::createTab(const QString &str, const QList<uint> &emoticons)
......@@ -53,3 +57,14 @@ void EmoticonUnicodeTab::createTab(const QString &str, const QList<uint> &emotic
//TODO add i18n ? or icons ?
addTab(selector, str);
}
bool EmoticonUnicodeTab::emojiPlainText() const
{
return mEmojiPlainText;
}
void EmoticonUnicodeTab::setEmojiPlainText(bool emojiPlainText)
{
mEmojiPlainText = emojiPlainText;
clear();
}
......@@ -32,12 +32,16 @@ public:
explicit EmoticonUnicodeTab(QWidget *parent = nullptr);
~EmoticonUnicodeTab();
Q_REQUIRED_RESULT bool emojiPlainText() const;
void setEmojiPlainText(bool emojiPlainText);
Q_SIGNALS:
void itemSelected(const QString &);
private:
void loadEmoticons();
void createTab(const QString &str, const QList<uint> &emoticons);
bool mEmojiPlainText = true;
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment