[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:05:39 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=3982fcb
The following commit has been merged in the master branch:
commit 3982fcbd66edb36b72d91608293187c1dbfcc68b
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date: Thu Mar 17 22:40:26 2011 +0100
Loose the timer on overlays, fix some delegate hardcoded positions and move the overlay buttons to the left. Not sure if this will stay though.
---
contact-delegate-overlay.cpp | 3 ++-
contact-delegate.cpp | 21 ++++++++++-----------
contact-overlays.cpp | 8 ++++----
3 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/contact-delegate-overlay.cpp b/contact-delegate-overlay.cpp
index 138cc7c..6b130f2 100644
--- a/contact-delegate-overlay.cpp
+++ b/contact-delegate-overlay.cpp
@@ -178,7 +178,8 @@ void AbstractWidgetDelegateOverlay::slotEntered(const QModelIndex& index)
if (index.isValid() && checkIndex(index)) {
//QTimer::singleShot(500, this, SLOT(slotWidgetAboutToShow(index)));
- QTimer::singleShot(500, m_widget, SLOT(show()));
+// QTimer::singleShot(500, m_widget, SLOT(show()));
+ m_widget->show();
emit overlayActivated(index);
}
}
diff --git a/contact-delegate.cpp b/contact-delegate.cpp
index 950ae63..24341d2 100644
--- a/contact-delegate.cpp
+++ b/contact-delegate.cpp
@@ -7,11 +7,13 @@
#include <KIconLoader>
#include <KIcon>
#include <KDebug>
+#include <KGlobalSettings>
#include "accounts-model.h"
const int SPACING = 4;
const int AVATAR_SIZE = 32;
+const int PRESENCE_ICON_SIZE = 22;
ContactDelegate::ContactDelegate(QObject * parent)
: QStyledItemDelegate(parent), ContactDelegateOverlayContainer(), m_palette(0)
@@ -75,17 +77,18 @@ void ContactDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opt
}
QRect statusIconRect = optV4.rect;
- statusIconRect.setSize(QSize(22, 22));
- statusIconRect.moveTo(QPoint(optV4.rect.right() - 24, optV4.rect.top() + 8));
+ statusIconRect.setSize(QSize(PRESENCE_ICON_SIZE, PRESENCE_ICON_SIZE));
+ statusIconRect.moveTo(QPoint(optV4.rect.right() - PRESENCE_ICON_SIZE - SPACING,
+ optV4.rect.top() + (optV4.rect.height() - PRESENCE_ICON_SIZE) / 2));
painter->drawPixmap(statusIconRect, icon);
QRect userNameRect = optV4.rect;
userNameRect.setX(iconRect.x() + iconRect.width() + SPACING);
userNameRect.setY(userNameRect.y() + 3);
- userNameRect.setWidth(userNameRect.width() - 28);
+ userNameRect.setWidth(userNameRect.width() - PRESENCE_ICON_SIZE - SPACING);
- QFont nameFont = painter->font();
+ QFont nameFont = painter->font();// KGlobalSettings::smallestReadableFont();
nameFont.setPixelSize(12);
nameFont.setWeight(QFont::Bold);
@@ -98,11 +101,9 @@ void ContactDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opt
QRect statusMsgRect = optV4.rect;
statusMsgRect.setX(iconRect.x() + iconRect.width() + SPACING);
statusMsgRect.setY(userNameRect.top() + 16);
- statusMsgRect.setWidth(statusMsgRect.width() - 28);
+ statusMsgRect.setWidth(statusMsgRect.width() - PRESENCE_ICON_SIZE - SPACING);
- QFont statusFont = painter->font();
- statusFont.setWeight(QFont::Normal);
- statusFont.setPixelSize(10);
+ QFont statusFont = KGlobalSettings::smallestReadableFont();
const QFontMetrics statusFontMetrics(statusFont);
@@ -131,9 +132,7 @@ void ContactDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opt
QRect expandSignRect = groupLabelRect;
expandSignRect.setLeft(groupLabelRect.right() - 20);
- QFont groupFont = painter->font();
- groupFont.setWeight(QFont::Normal);
- groupFont.setPixelSize(10);
+ QFont groupFont = KGlobalSettings::smallestReadableFont();
QString counts;// = QString(" (%1/%2)").arg(index.data(AccountsModel::).toString(),
// index.data(ModelRoles::AccountAllContactsCountRole).toString());
diff --git a/contact-overlays.cpp b/contact-overlays.cpp
index 43e6cd1..0869ef8 100644
--- a/contact-overlays.cpp
+++ b/contact-overlays.cpp
@@ -102,7 +102,7 @@ void TextChannelContactOverlay::updateButton(const QModelIndex& index)
const QSize size = button()->size();
const int gap = 5;
- const int x = rect.right() - gap - 96 - size.width();
+ const int x = rect.left() + 40;// rect.right() - gap - 96 - size.width();
const int y = rect.bottom() - gap - size.height();
button()->move(QPoint(x, y));
}
@@ -203,7 +203,7 @@ void AudioChannelContactOverlay::updateButton(const QModelIndex& index)
const QSize size = button()->size();
const int gap = 5;
- const int x = rect.right() - gap - 72 - size.width();
+ const int x = rect.left() + 64; //rect.right() - gap - 72 - size.width();
const int y = rect.bottom() - gap - size.height();
button()->move(QPoint(x, y));
}
@@ -304,7 +304,7 @@ void VideoChannelContactOverlay::updateButton(const QModelIndex& index)
const QSize size = button()->size();
const int gap = 5;
- const int x = rect.right() - gap - 50 - size.width();
+ const int x = rect.left() + 88;// rect.right() - gap - 50 - size.width();
const int y = rect.bottom() - gap - size.height();
button()->move(QPoint(x, y));
}
@@ -405,7 +405,7 @@ void FileTransferContactOverlay::updateButton(const QModelIndex& index)
const QSize size = button()->size();
const int gap = 5;
- const int x = rect.right() - gap - 132 - size.width();
+ const int x = rect.left() + 128;//rect.right() - gap - 132 - size.width();
const int y = rect.bottom() - gap - size.height();
button()->move(QPoint(x, y));
}
--
ktp-contact-list packaging
More information about the pkg-kde-commits
mailing list