Give more space around top of covers in icon view - so that selection looks nicer

This commit is contained in:
craig.p.drummond
2014-06-30 18:44:00 +00:00
committed by craig.p.drummond
parent 5c5860a178
commit 382ddaa280
2 changed files with 7 additions and 6 deletions

View File

@@ -65,15 +65,15 @@ QRect ActionItemDelegate::calcActionRect(bool rtl, ActionPos actionPos, const QR
QRect rect=AP_HBottom==actionPos ? QRect(o.x(), o.y()+(o.height()/2), o.width(), o.height()/2) : o;
return rtl
? AP_VTop==actionPos
? QRect(rect.x()+5,
rect.y()+2,
? QRect(rect.x()+(constBorder*4),
rect.y()+(constBorder*4),
iconSize, iconSize)
: QRect(rect.x()+constActionBorder,
rect.y()+((rect.height()-iconSize)/2),
iconSize, iconSize)
: AP_VTop==actionPos
? QRect(rect.x()+rect.width()-(iconSize+5),
rect.y()+2,
? QRect(rect.x()+rect.width()-(iconSize+(constBorder*4)),
rect.y()+(constBorder*4),
iconSize, iconSize)
: QRect(rect.x()+rect.width()-(iconSize+constActionBorder),
rect.y()+((rect.height()-iconSize)/2),

View File

@@ -247,7 +247,7 @@ public:
}
if (AP_VTop==actionPos) {
r.adjust(constBorder, constBorder, -constBorder, -constBorder);
r.adjust(constBorder, constBorder*4, -constBorder, -constBorder);
r2=r;
} else {
r.adjust(constBorder, 0, -constBorder, 0);
@@ -316,7 +316,8 @@ public:
int childHeight=childMetrics.height();
int totalHeight=textHeight+childHeight;
textRect=QRect(r.x(), r.y()+((r.height()-totalHeight)/2), r.width(), textHeight);
childRect=QRect(r.x(), r.y()+textHeight+((r.height()-totalHeight)/2), r.width(), textHeight);
childRect=QRect(r.x(), r.y()+textHeight+((r.height()-totalHeight)/2), r.width(),
(iconMode ? textHeight-(2*constBorder) : textHeight));
text = textMetrics.elidedText(text, Qt::ElideRight, textRect.width(), QPalette::WindowText);
painter->setPen(color);