diff options
author | Thanos Doukoudakis <thanos.doukoudakis@isode.com> | 2018-04-16 09:59:34 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2018-05-10 08:13:57 (GMT) |
commit | 4663da31954d989f8535b94c4a78a0f4515542a4 (patch) | |
tree | aa6cf7a359ed0e61e038f3f518581bc9351d52f9 /Swift/QtUI/QtChatWindow.cpp | |
parent | 8fab33012e5ac7c03ab00ec30118dcb2c5218051 (diff) | |
download | swift-4663da31954d989f8535b94c4a78a0f4515542a4.zip swift-4663da31954d989f8535b94c4a78a0f4515542a4.tar.bz2 |
Enable Emojis on Windows and Linux
This patch enables emojis for Linux and Windows. In windows, currently the
emojis are only black and white, due to some inconsistencies in the UI.
For Linux the Noto Colour Emoji font (https://www.google.com/get/noto/) is
used.
The client must be build with Qt 5.6 or newer to support the emoji
characters.
Test-Information:
Tested the changes with Qt 5.8 on Windows 10 and Linux Ubuntu 17.10.
Built and tested the appimage on Ubuntu 17.10 and Ubuntu 16.04.
Change-Id: I6d0f2842349eae789d773c33d1a93ad33304df3e
Diffstat (limited to 'Swift/QtUI/QtChatWindow.cpp')
-rw-r--r-- | Swift/QtUI/QtChatWindow.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp index 231a9b9..cbdab48 100644 --- a/Swift/QtUI/QtChatWindow.cpp +++ b/Swift/QtUI/QtChatWindow.cpp @@ -155,11 +155,15 @@ QtChatWindow::QtChatWindow(const QString& contact, QtChatTheme* theme, UIEventSt connect(input_, SIGNAL(lostFocus()), this, SLOT(handleTextInputLostFocus())); connect(input_, SIGNAL(itemDropped(QDropEvent*)), this, SLOT(dropEvent(QDropEvent*))); QPushButton* emojisButton_ = new QPushButton(this); - -#ifdef SWIFTEN_PLATFORM_MACOSX emojisButton_->setText("\xF0\x9F\x98\x83"); -#else - emojisButton_->setIcon(QIcon(":/emoticons/smile.png")); + +#if defined(SWIFTEN_PLATFORM_WINDOWS) || defined(SWIFTEN_PLATFORM_LINUX) + //Using a emoji glyph instead of an image makes the button sizes inequal in windows & linux, + //so we set fixed size for both buttons, the one that is hinted for actionButton_ + emojisButton_->setMaximumWidth(actionButton_->sizeHint().width()); + emojisButton_->setMaximumHeight(actionButton_->sizeHint().height()); + actionButton_->setMaximumWidth(actionButton_->sizeHint().width()); + actionButton_->setMaximumHeight(actionButton_->sizeHint().height()); #endif connect(emojisButton_, SIGNAL(clicked()), this, SLOT(handleEmojisButtonClicked())); |