mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-13 16:39:43 -05:00
fixed elided label when size is too small to draw anything
This commit is contained in:
parent
09c5d93631
commit
61083ff77a
@ -200,7 +200,8 @@ bool ElidedLabel::paintElidedLine(QPainter& painter,QString plainText,const QRec
|
||||
iTransX = 0;
|
||||
}
|
||||
|
||||
painter.drawText(QPoint(iTransX + cr.left(), y + fontMetrics.ascent() + cr.top()), elidedLastLine);
|
||||
if(width+iTransX+cr.left() <= cr.right())
|
||||
painter.drawText(QPoint(iTransX + cr.left(), y + fontMetrics.ascent() + cr.top()), elidedLastLine);
|
||||
//Draw button to get ToolTip
|
||||
|
||||
if(drawRoundRect)
|
||||
|
@ -263,7 +263,10 @@ void GxsIdTreeItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem
|
||||
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);
|
||||
|
||||
// draw pixmap at center of item
|
||||
|
Loading…
Reference in New Issue
Block a user