]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistwidget.cpp
Details view: Expand the name-column like in Dolphin 1.x
[dolphin.git] / src / kitemviews / kitemlistwidget.cpp
index 24a3f079a9005cd6dd790330cf7e3f92960ea1ef..951fb396c54faa540771d32bc1fc10fd981f16f6 100644 (file)
@@ -40,7 +40,7 @@ KItemListWidget::KItemListWidget(QGraphicsItem* parent) :
     m_selected(false),
     m_current(false),
     m_hovered(false),
-    m_alternatingBackgroundColors(false),
+    m_alternateBackground(false),
     m_enabledSelectionToggle(false),
     m_data(),
     m_visibleRoles(),
@@ -105,9 +105,7 @@ void KItemListWidget::paint(QPainter* painter, const QStyleOptionGraphicsItem* o
 {
     Q_UNUSED(option);
 
-    painter->setRenderHint(QPainter::Antialiasing);
-
-    if (m_alternatingBackgroundColors && (m_index & 0x1)) {
+    if (m_alternateBackground) {
         const QColor backgroundColor = m_styleOption.palette.color(QPalette::AlternateBase);
         const QRectF backgroundRect(0, 0, size().width(), size().height());
         painter->fillRect(backgroundRect, backgroundColor);
@@ -249,7 +247,7 @@ void KItemListWidget::setHovered(bool hovered)
 
     if (!m_hoverAnimation) {
         m_hoverAnimation = new QPropertyAnimation(this, "hoverOpacity", this);
-        const int duration = (KGlobalSettings::graphicEffectsLevel() == KGlobalSettings::NoEffects) ? 1 : 200;       
+        const int duration = (KGlobalSettings::graphicEffectsLevel() == KGlobalSettings::NoEffects) ? 1 : 200;
         m_hoverAnimation->setDuration(duration);
         connect(m_hoverAnimation, SIGNAL(finished()), this, SLOT(slotHoverAnimationFinished()));
     }
@@ -278,18 +276,18 @@ bool KItemListWidget::isHovered() const
     return m_hovered;
 }
 
-void KItemListWidget::setAlternatingBackgroundColors(bool enable)
+void KItemListWidget::setAlternateBackground(bool enable)
 {
-    if (m_alternatingBackgroundColors != enable) {
-        m_alternatingBackgroundColors = enable;
-        alternatingBackgroundColorsChanged(enable);
+    if (m_alternateBackground != enable) {
+        m_alternateBackground = enable;
+        alternateBackgroundChanged(enable);
         update();
     }
 }
 
-bool KItemListWidget::alternatingBackgroundColors() const
+bool KItemListWidget::alternateBackground() const
 {
-    return m_alternatingBackgroundColors;
+    return m_alternateBackground;
 }
 
 void KItemListWidget::setEnabledSelectionToggle(bool enable)
@@ -383,7 +381,7 @@ void KItemListWidget::hoveredChanged(bool hovered)
     Q_UNUSED(hovered);
 }
 
-void KItemListWidget::alternatingBackgroundColorsChanged(bool enabled)
+void KItemListWidget::alternateBackgroundChanged(bool enabled)
 {
     Q_UNUSED(enabled);
 }