mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-22 12:56:37 -04:00
fixed elided label when size is too small to draw anything
This commit is contained in:
parent
09c5d93631
commit
61083ff77a
2 changed files with 6 additions and 2 deletions
|
@ -200,6 +200,7 @@ bool ElidedLabel::paintElidedLine(QPainter& painter,QString plainText,const QRec
|
||||||
iTransX = 0;
|
iTransX = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(width+iTransX+cr.left() <= cr.right())
|
||||||
painter.drawText(QPoint(iTransX + cr.left(), y + fontMetrics.ascent() + cr.top()), elidedLastLine);
|
painter.drawText(QPoint(iTransX + cr.left(), y + fontMetrics.ascent() + cr.top()), elidedLastLine);
|
||||||
//Draw button to get ToolTip
|
//Draw button to get ToolTip
|
||||||
|
|
||||||
|
|
|
@ -263,7 +263,10 @@ void GxsIdTreeItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem
|
||||||
launchAsyncLoading();
|
launchAsyncLoading();
|
||||||
}
|
}
|
||||||
|
|
||||||
QPixmap pix = icon.pixmap(r.size());
|
QRect pixmaprect(r);
|
||||||
|
pixmaprect.adjust(r.height(),0,0,0);
|
||||||
|
|
||||||
|
QPixmap pix = icon.pixmap(pixmaprect.size());
|
||||||
const QPoint p = QPoint(r.height()/2.0, (r.height() - pix.height())/2);
|
const QPoint p = QPoint(r.height()/2.0, (r.height() - pix.height())/2);
|
||||||
|
|
||||||
// draw pixmap at center of item
|
// draw pixmap at center of item
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue