┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dolphincolumnview.cpp8
-rw-r--r--src/dolphincolumnwidget.cpp14
2 files changed, 15 insertions, 7 deletions
diff --git a/src/dolphincolumnview.cpp b/src/dolphincolumnview.cpp
index 54dc8fe3b..82d571724 100644
--- a/src/dolphincolumnview.cpp
+++ b/src/dolphincolumnview.cpp
@@ -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) {
diff --git a/src/dolphincolumnwidget.cpp b/src/dolphincolumnwidget.cpp
index 195d0fc01..002c2cf28 100644
--- a/src/dolphincolumnwidget.cpp
+++ b/src/dolphincolumnwidget.cpp
@@ -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();