]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphincolumnwidget.cpp
fixed HIG color violations
[dolphin.git] / src / dolphincolumnwidget.cpp
index 195d0fc0124975a5192bd8e4a6d169b68b4b8c09..002c2cf28dd64cc06e919f3193eac3156f5daa27 100644 (file)
@@ -184,12 +184,16 @@ void DolphinColumnWidget::setShowPreview(bool show)
 
 void DolphinColumnWidget::updateBackground()
 {
-    QColor color = KColorScheme(QPalette::Active, KColorScheme::View).background().color();
-    if (!m_active || !m_view->m_active) {
-        color.setAlpha(150);
-    }
+    // TODO: The alpha-value 150 is copied from DolphinView::setActive(). When
+    // cleaning up the cut-indication of DolphinColumnWidget with the code from
+    // DolphinView a common helper-class should be available which can be shared
+    // by all view implementations -> no hardcoded value anymore
+    const QPalette::ColorRole role = viewport()->backgroundRole();
+    QColor color = viewport()->palette().color(role);
+    color.setAlpha((m_active && m_view->m_active) ? 255 : 150);
+
     QPalette palette = viewport()->palette();
-    palette.setColor(viewport()->backgroundRole(), color);
+    palette.setColor(role, color);
     viewport()->setPalette(palette);
 
     update();