Fwd: dolphin, transparent background

Thomas Lübking thomas.luebking at web.de
Tue Sep 9 14:46:03 BST 2008


Peter penz is offline so i'm fwd this mail here, please include me in cc if 
you need to reply as i'm not registered to this list, thanks


----------  Weitergeleitete Nachricht  ----------

Subject: kfileplacesview, transparent background
Date: Tuesday 09 September 2008
From: Thomas Lübking <thomas.luebking at web.de>
To: Rafael Fernández López <ereslibre at kde.org>

statusbarmessagelabel.cpp #46
QPalette palette;
palette.setColor(QPalette::Background, Qt::transparent);
setPalette(palette);
is probably redundant, as widgets are transparent anyway 'nowerdays
(looks like Qt3 ported code ;-)

but:

sidebartreeview.cpp, #49
QPalette palette = viewport()->palette();
palette.setColor(viewport()->backgroundRole(), Qt::transparent);
viewport()->setPalette(palette);

this seems to be a common problem:
it triggers problems if QPalette::Text does not contrast QPalette::Window 
(the new effective bg color), so you probably want to
palette.setColor(QPalette::*, QPalette::Text 
palette.color(QPalette::*, QPalette::WindowText));
* = Active, Inactive, Disabled

+++ AND +++ for some reason (Qt?!) it seems as if the corrected palette needs 
to be applied to the scrollarea, NOT the viewport (i.e. does not work then)

in general it may be a "more proper" way to set
palette.setColor(viewport()->backgroundRole(), palette.color(QPalette::*, 
QPalette::Window));
and in addition
viewport()->setAutofillBackground(false);
to keep an idea of what the widget looks like
(still needs to be applied on the scrollarea, adjusting the 
background/foreground roles does NOT work - due to Qt for sure this time)

Thomas





More information about the kfm-devel mailing list