]> cloud.milkyroute.net Git - dolphin.git/commitdiff
fixed HIG color violations
authorPeter Penz <peter.penz19@gmail.com>
Thu, 10 Jan 2008 18:24:57 +0000 (18:24 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Thu, 10 Jan 2008 18:24:57 +0000 (18:24 +0000)
BUG: 153363

svn path=/trunk/KDE/kdebase/apps/; revision=759482

src/dolphincolumnview.cpp
src/dolphincolumnwidget.cpp

index 54dc8fe3b57aa874f82ee82fa749b85272ebefda..82d571724183d07d14f7d5e577e030638a3c4c7e 100644 (file)
@@ -393,8 +393,12 @@ void DolphinColumnView::updateColumnsBackground(bool active)
     m_active = active;
 
     // dim the background of the viewport
-    QPalette palette;
-    palette.setColor(viewport()->backgroundRole(), QColor(0, 0, 0, 0));
+    const QPalette::ColorRole role = viewport()->backgroundRole();
+    QColor background = viewport()->palette().color(role);
+    background.setAlpha(0);  // make background transparent
+
+    QPalette palette = viewport()->palette();
+    palette.setColor(role, background);
     viewport()->setPalette(palette);
 
     foreach (DolphinColumnWidget* column, m_columns) {
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();