Give more space around top of covers in icon view - so that selection looks nicer
This commit is contained in:
committed by
craig.p.drummond
parent
5c5860a178
commit
382ddaa280
@@ -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),
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user