PDA

View Full Version : Plasmoid opacity



AcerExtensa
25th July 2009, 00:59
Hi all!
Do anybody know how to set opacity for plasmoid?
Background transparency like Desktop Folder plasmoid has...
I have tried with QPointer::setOpacity() but that doesn't work.



void TestPlasmoid::paintInterface(QPainter *p, const QStyleOptionGraphicsItem *option, const QRect &contentsRect)
{
p->setOpacity(0.2);
}

Lykurg
25th July 2009, 07:44
Isn't the background drawn by your current plasma theme? And please show us, what your base class is and have do you set/draw the background.

ivan.cukic
25th July 2009, 09:49
The FolderView plasmoid uses a different background image - the "widgets/translucentbackground" instead of the normal "widgets/background".

So, the appearance is not hard-coded, and (depending on the theme) the FV could have even more opaque background than the normal plasmoids.

AcerExtensa
25th July 2009, 15:22
Thanks for help! I figured it out, setBackgroundHints(Plasma::Applet::TranslucentBack ground); makes the trick.