{
const_cast<KFileItemListWidget*>(this)->triggerCacheRefreshing();
- const int iconHeight = m_pixmap.height();
+ const int iconHeight = styleOption().iconSize;
int toggleSize = KIconLoader::SizeSmall;
if (iconHeight >= KIconLoader::SizeEnormous) {
// when trying to hit the toggle.
const int widgetHeight = size().height();
const int widgetWidth = size().width();
- const int minPadding = 2;
+ const int minMargin = 2;
- if (toggleSize + minPadding * 2 >= widgetHeight) {
+ if (toggleSize + minMargin * 2 >= widgetHeight) {
+ pos.rx() -= (widgetHeight - toggleSize) / 2;
toggleSize = widgetHeight;
pos.setY(0);
}
- if (toggleSize + minPadding * 2 >= widgetWidth) {
+ if (toggleSize + minMargin * 2 >= widgetWidth) {
+ pos.ry() -= (widgetWidth - toggleSize) / 2;
toggleSize = widgetWidth;
pos.setX(0);
}
}
m_iconRect = QRectF(m_pixmapPos, QSizeF(m_scaledPixmapSize));
- m_iconRect.adjust(-padding, -padding, padding, padding);
// Prepare the pixmap that is used when the item gets hovered
if (isHovered()) {
m_xPosInc = itemMargin.width();
const int itemCount = m_model->count();
- if (itemCount > m_columnCount) {
+ if (itemCount > m_columnCount && m_columnWidth >= 32) {
// Apply the unused width equally to each column
const qreal unusedWidth = size.width() - m_columnCount * m_columnWidth;
if (unusedWidth > 0) {