mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-20 00:41:23 +00:00
fixed HIG color violations
BUG: 153363 svn path=/trunk/KDE/kdebase/apps/; revision=759482
This commit is contained in:
parent
c929652fe0
commit
268571ebc6
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue