- KItemListWidget::paint(painter, option, widget);
-
- const_cast<KFileItemListWidget*>(this)->triggerCacheRefreshing();
-
- // Draw expansion toggle '>' or 'V'
- if (m_isDir && !m_expansionArea.isEmpty()) {
- QStyleOption arrowOption;
- arrowOption.rect = m_expansionArea.toRect();
- const QStyle::PrimitiveElement arrow = data()["isExpanded"].toBool()
- ? QStyle::PE_IndicatorArrowDown : QStyle::PE_IndicatorArrowRight;
- style()->drawPrimitive(arrow, &arrowOption, painter);
- }
-
- const KItemListStyleOption& itemListStyleOption = styleOption();
- if (isHovered()) {
- // Blend the unhovered and hovered pixmap if the hovering
- // animation is ongoing
- if (hoverOpacity() < 1.0) {
- drawPixmap(painter, m_pixmap);
- }
-
- const qreal opacity = painter->opacity();
- painter->setOpacity(hoverOpacity() * opacity);
- drawPixmap(painter, m_hoverPixmap);
- painter->setOpacity(opacity);
- } else {
- drawPixmap(painter, m_pixmap);
- }
-
- painter->setFont(itemListStyleOption.font);
- painter->setPen(textColor());
- painter->drawStaticText(m_textPos[Name], m_text[Name]);
-
- bool clipAdditionalInfoBounds = false;
- if (m_layout == DetailsLayout) {
- // Prevent a possible overlapping of the additional-information texts
- // with the icon. This can happen if the user has minimized the width
- // of the name-column to a very small value.
- const qreal minX = m_pixmapPos.x() + m_pixmap.width() + 4 * itemListStyleOption.margin;
- if (m_textPos[Name + 1].x() < minX) {
- clipAdditionalInfoBounds = true;
- painter->save();
- painter->setClipRect(minX, 0, size().width() - minX, size().height(), Qt::IntersectClip);
- }
- }
-
- painter->setPen(m_additionalInfoTextColor);
- painter->setFont(itemListStyleOption.font);
- for (int i = Name + 1; i < TextIdCount; ++i) {
- painter->drawStaticText(m_textPos[i], m_text[i]);
- }
-
- if (clipAdditionalInfoBounds) {
- painter->restore();
- }
-
-#ifdef KFILEITEMLISTWIDGET_DEBUG
- painter->setPen(Qt::red);
- painter->setBrush(Qt::NoBrush);
- painter->drawText(QPointF(0, itemListStyleOption.fontMetrics.height()), QString::number(index()));
- painter->drawRect(rect());
-#endif