fixed HIG color violations

BUG: 153363

svn path=/trunk/KDE/kdebase/apps/; revision=759482
This commit is contained in:
Peter Penz 2008-01-10 18:24:57 +00:00
parent f2bf4eafc0
commit fd1c05b141
2 changed files with 15 additions and 7 deletions

View 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) {

View 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();