summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-05-23 15:31:23 (GMT)
committerKevin Smith <kevin.smith@isode.com>2016-07-25 14:05:23 (GMT)
commitc7ea4a479d2f63c73278f934f68bbb5d5430a334 (patch)
tree62b180742186535902cd425448a041853eaba2a1 /Swift/QtUI
parent1759abcc579bbd602f5ea5d59cfbdcb8a4e94fea (diff)
downloadswift-c7ea4a479d2f63c73278f934f68bbb5d5430a334.zip
swift-c7ea4a479d2f63c73278f934f68bbb5d5430a334.tar.bz2
Changing default avatar to a blue circled swift
The old default avatar does not work well with the new chat view design which uses circled avatars. This also uses the vector avatar internally in Swift and has Qt and the chat view engine scale it to the required size. Test-Information: Tested on OS X 10.11.5 with non-compact chat views and MUC conversations. Change-Id: I82580ecb91fc81f4fe9535aa9d3b214b720a40f3
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtRosterHeader.cpp2
-rw-r--r--Swift/QtUI/QtWebKitChatView.cpp8
-rw-r--r--Swift/QtUI/Roster/DelegateCommons.cpp2
-rw-r--r--Swift/QtUI/Roster/RosterTooltip.cpp2
-rw-r--r--Swift/QtUI/Swift.qrc2
5 files changed, 8 insertions, 8 deletions
diff --git a/Swift/QtUI/QtRosterHeader.cpp b/Swift/QtUI/QtRosterHeader.cpp
index 11dacb0..b405d10 100644
--- a/Swift/QtUI/QtRosterHeader.cpp
+++ b/Swift/QtUI/QtRosterHeader.cpp
@@ -119,7 +119,7 @@ void QtRosterHeader::setAvatar(const QString& path) {
avatar.load(scaledAvatarPath);
}
else {
- avatar = QPixmap(":/icons/avatar.png").scaled(avatarSize_, avatarSize_, Qt::KeepAspectRatio, Qt::SmoothTransformation);
+ avatar = QPixmap(":/icons/avatar.svg").scaled(avatarSize_, avatarSize_, Qt::KeepAspectRatio, Qt::SmoothTransformation);
}
avatarLabel_->setPixmap(avatar);
}
diff --git a/Swift/QtUI/QtWebKitChatView.cpp b/Swift/QtUI/QtWebKitChatView.cpp
index afa2d5e..f369e35 100644
--- a/Swift/QtUI/QtWebKitChatView.cpp
+++ b/Swift/QtUI/QtWebKitChatView.cpp
@@ -549,7 +549,7 @@ std::string QtWebKitChatView::addMessage(
bool appendToPrevious = appendToPreviousCheck(PreviousMessageWasMessage, senderName, senderIsSelf);
- QString qAvatarPath = scaledAvatarPath.isEmpty() ? "qrc:/icons/avatar.png" : QUrl::fromLocalFile(scaledAvatarPath).toEncoded();
+ QString qAvatarPath = scaledAvatarPath.isEmpty() ? "qrc:/icons/avatar.svg" : QUrl::fromLocalFile(scaledAvatarPath).toEncoded();
std::string id = "id" + boost::lexical_cast<std::string>(idCounter_++);
addMessageBottom(std::make_shared<MessageSnippet>(htmlString, QtUtilities::htmlEscape(P2QSTRING(senderName)), B2QDATE(time), qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id), direction));
@@ -624,7 +624,7 @@ std::string QtWebKitChatView::addFileTransfer(const std::string& senderName, boo
bool appendToPrevious = appendToPreviousCheck(PreviousMessageWasFileTransfer, senderName, senderIsSelf);
- QString qAvatarPath = "qrc:/icons/avatar.png";
+ QString qAvatarPath = "qrc:/icons/avatar.svg";
std::string id = "ftmessage" + boost::lexical_cast<std::string>(idCounter_++);
addMessageBottom(std::make_shared<MessageSnippet>(htmlString, QtUtilities::htmlEscape(P2QSTRING(senderName)), B2QDATE(boost::posix_time::second_clock::universal_time()), qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id), ChatSnippet::getDirection(actionText)));
@@ -658,7 +658,7 @@ std::string QtWebKitChatView::addWhiteboardRequest(const QString& contact, bool
buildChatWindowButton(tr("Accept"), ButtonWhiteboardSessionAcceptRequest, wb_id) +
"</div>";
}
- QString qAvatarPath = "qrc:/icons/avatar.png";
+ QString qAvatarPath = "qrc:/icons/avatar.svg";
std::string id = "wbmessage" + boost::lexical_cast<std::string>(idCounter_++);
addMessageBottom(std::make_shared<MessageSnippet>(htmlString, QtUtilities::htmlEscape(contact), B2QDATE(boost::posix_time::second_clock::universal_time()), qAvatarPath, false, false, theme_, P2QSTRING(id), ChatSnippet::getDirection(actionText)));
previousMessageWasSelf_ = false;
@@ -919,7 +919,7 @@ void QtWebKitChatView::addMUCInvitation(const std::string& senderName, const JID
bool appendToPrevious = appendToPreviousCheck(PreviousMessageWasMUCInvite, senderName, false);
- QString qAvatarPath = "qrc:/icons/avatar.png";
+ QString qAvatarPath = "qrc:/icons/avatar.svg";
addMessageBottom(std::make_shared<MessageSnippet>(htmlString, QtUtilities::htmlEscape(P2QSTRING(senderName)), B2QDATE(boost::posix_time::second_clock::universal_time()), qAvatarPath, false, appendToPrevious, theme_, id, ChatSnippet::getDirection(message)));
previousMessageWasSelf_ = false;
diff --git a/Swift/QtUI/Roster/DelegateCommons.cpp b/Swift/QtUI/Roster/DelegateCommons.cpp
index 517683b..c1c1244 100644
--- a/Swift/QtUI/Roster/DelegateCommons.cpp
+++ b/Swift/QtUI/Roster/DelegateCommons.cpp
@@ -45,7 +45,7 @@ void DelegateCommons::paintContact(QPainter* painter, const QStyleOptionViewItem
}
}
if (!compact && avatarPixmap.isNull()) {
- avatarPixmap = QPixmap(":/icons/avatar.png").scaled(avatarRegion.height(), avatarRegion.width(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
+ avatarPixmap = QPixmap(":/icons/avatar.svg").scaled(avatarRegion.height(), avatarRegion.width(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
}
if (!compact) {
diff --git a/Swift/QtUI/Roster/RosterTooltip.cpp b/Swift/QtUI/Roster/RosterTooltip.cpp
index d151628..8ecd276 100644
--- a/Swift/QtUI/Roster/RosterTooltip.cpp
+++ b/Swift/QtUI/Roster/RosterTooltip.cpp
@@ -85,7 +85,7 @@ QString RosterTooltip::buildDetailedTooltip(ContactRosterItem* contact, QtScaled
contact->onVCardRequested();
}
- QString scaledAvatarPath = cachedImageScaler->getScaledAvatarPath(P2QSTRING(contact->getAvatarPath().empty() ? ":/icons/avatar.png" : pathToString(contact->getAvatarPath())));
+ QString scaledAvatarPath = cachedImageScaler->getScaledAvatarPath(P2QSTRING(contact->getAvatarPath().empty() ? ":/icons/avatar.svg" : pathToString(contact->getAvatarPath())));
QString bareJID = contact->getDisplayJID().toString().empty() ? "" : "( " + P2QSTRING(contact->getDisplayJID().toString()) + " )";
diff --git a/Swift/QtUI/Swift.qrc b/Swift/QtUI/Swift.qrc
index 3c9f43f..4c8fd55 100644
--- a/Swift/QtUI/Swift.qrc
+++ b/Swift/QtUI/Swift.qrc
@@ -16,7 +16,7 @@
<file alias="icons/warn.png">../resources/icons/warn.png</file>
<file alias="icons/check.png">../resources/icons/check.png</file>
<file alias="icons/throbber.gif">../resources/icons/throbber.gif</file>
- <file alias="icons/avatar.png">../resources/icons/avatar.png</file>
+ <file alias="icons/avatar.svg">../resources/icons/avatar.svg</file>
<file alias="icons/no-avatar.png">../resources/icons/no-avatar.png</file>
<file alias="icons/tray-standard.png">../resources/icons/tray-standard.png</file>
<file alias="icons/new-chat.png">../resources/icons/new-chat.png</file>