[SCM] ktp-contact-list packaging branch, master, updated. debian/15.12.1-2-1070-g6c56f91
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:13:59 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=d27d154
The following commit has been merged in the master branch:
commit d27d1545cb8253184f6c1d54fbe6dffe885ad6d9
Author: David Edmundson <kde at davidedmundson.co.uk>
Date: Fri Sep 13 12:20:02 2013 +0000
Show account icon on subcontacts
REVIEW: 112711
---
contact-delegate-compact.cpp | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/contact-delegate-compact.cpp b/contact-delegate-compact.cpp
index 5b92c8e..509814f 100644
--- a/contact-delegate-compact.cpp
+++ b/contact-delegate-compact.cpp
@@ -91,7 +91,7 @@ void ContactDelegateCompact::paintContact(QPainter *painter, const QStyleOptionV
// Right now we only check for 'phone', as that's the most interesting type.
if (index.data(KTp::ContactClientTypesRole).toStringList().contains(QLatin1String("phone"))) {
// Additional space is needed for the icons, don't add too much spacing between the two icons
- rightIconsWidth += m_clientTypeIconSize + (m_spacing / 2);
+ rightIconsWidth += m_clientTypeIconSize + m_spacing;
QPixmap phone = QIcon::fromTheme("phone").pixmap(m_clientTypeIconSize);
QRect phoneIconRect = optV4.rect;
@@ -101,6 +101,18 @@ void ContactDelegateCompact::paintContact(QPainter *painter, const QStyleOptionV
painter->drawPixmap(phoneIconRect, phone);
}
+ const Tp::AccountPtr &account = index.data(KTp::AccountRole).value<Tp::AccountPtr>();
+ if (account && isSubcontact) {
+ rightIconsWidth += m_clientTypeIconSize + m_spacing;
+
+ const QPixmap accountIcon = KIcon(account->iconName()).pixmap(m_clientTypeIconSize);
+ QRect accountIconRect = optV4.rect;
+ accountIconRect.setSize(QSize(m_clientTypeIconSize, m_clientTypeIconSize));
+ accountIconRect.moveTo(QPoint(optV4.rect.right() - rightIconsWidth,
+ optV4.rect.top() + (optV4.rect.height() - m_clientTypeIconSize) / 2));
+ painter->drawPixmap(accountIconRect, accountIcon);
+ }
+
QFont nameFont;
if (m_listSize == ContactDelegateCompact::Mini) {
--
ktp-contact-list packaging
More information about the pkg-kde-commits
mailing list