mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-19 00:11:21 +00:00
fixed HIG color violations
BUG: 153363 svn path=/trunk/KDE/kdebase/apps/; revision=759482
This commit is contained in:
parent
f2bf4eafc0
commit
fd1c05b141
|
@ -393,8 +393,12 @@ void DolphinColumnView::updateColumnsBackground(bool active)
|
||||||
m_active = active;
|
m_active = active;
|
||||||
|
|
||||||
// dim the background of the viewport
|
// dim the background of the viewport
|
||||||
QPalette palette;
|
const QPalette::ColorRole role = viewport()->backgroundRole();
|
||||||
palette.setColor(viewport()->backgroundRole(), QColor(0, 0, 0, 0));
|
QColor background = viewport()->palette().color(role);
|
||||||
|
background.setAlpha(0); // make background transparent
|
||||||
|
|
||||||
|
QPalette palette = viewport()->palette();
|
||||||
|
palette.setColor(role, background);
|
||||||
viewport()->setPalette(palette);
|
viewport()->setPalette(palette);
|
||||||
|
|
||||||
foreach (DolphinColumnWidget* column, m_columns) {
|
foreach (DolphinColumnWidget* column, m_columns) {
|
||||||
|
|
|
@ -184,12 +184,16 @@ void DolphinColumnWidget::setShowPreview(bool show)
|
||||||
|
|
||||||
void DolphinColumnWidget::updateBackground()
|
void DolphinColumnWidget::updateBackground()
|
||||||
{
|
{
|
||||||
QColor color = KColorScheme(QPalette::Active, KColorScheme::View).background().color();
|
// TODO: The alpha-value 150 is copied from DolphinView::setActive(). When
|
||||||
if (!m_active || !m_view->m_active) {
|
// cleaning up the cut-indication of DolphinColumnWidget with the code from
|
||||||
color.setAlpha(150);
|
// 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();
|
QPalette palette = viewport()->palette();
|
||||||
palette.setColor(viewport()->backgroundRole(), color);
|
palette.setColor(role, color);
|
||||||
viewport()->setPalette(palette);
|
viewport()->setPalette(palette);
|
||||||
|
|
||||||
update();
|
update();
|
||||||
|
|
Loading…
Reference in a new issue