fixed sizes in GxsIdTreeWidgetItem

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8559 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-06-27 09:14:20 +00:00
parent 765e2a15ed
commit 8822d12707

View File

@ -81,7 +81,7 @@ static void fillGxsIdRSTreeWidgetItemCallback(GxsIdDetailsType type, const RsIde
QPixmap combinedPixmap;
if (!icons.empty()) {
GxsIdDetails::GenerateCombinedPixmap(combinedPixmap, icons, 16);
GxsIdDetails::GenerateCombinedPixmap(combinedPixmap, icons, QFontMetricsF(item->font(item->idColumn())).height()*1.1);
}
item->setData(column, Qt::DecorationRole, combinedPixmap);
item->setAvatar(details.mAvatar);
@ -150,8 +150,10 @@ QVariant GxsIdRSTreeWidgetItem::data(int column, int role) const
pix = GxsIdDetails::makeDefaultIcon(mId);
}
int S = QFontMetricsF(font(column)).height();
QString embeddedImage;
if (RsHtml::makeEmbeddedImage(pix.scaled(QSize(64,64), Qt::KeepAspectRatio, Qt::SmoothTransformation), embeddedImage, 128 * 128)) {
if (RsHtml::makeEmbeddedImage(pix.scaled(QSize(4*S,4*S), Qt::KeepAspectRatio, Qt::SmoothTransformation), embeddedImage, 8*S * 8*S)) {
t = "<table><tr><td>" + embeddedImage + "</td><td>" + t + "</td></table>";
}