Manual Hiding of Plasma Panel (desktop shell)

Andrzej JR Hunt andrzej at ahunt.org
Wed Mar 10 18:11:55 CET 2010


> > - The suggested method is to make the panel containment smaller than the
> > view, then adding the buttons in the empty space at either end of the
> > view, and painting the background to make it one with the containment?
> > (This would require rewriting all of the view's calls to resize the
> > containment to leave the required space, and possibly to position it,
> > since the containment isn't currently affected by the contents margins of
> > the view, and the viewport margins of the view only affect the visible
> > area, but not the actual size, of the panel containment. Alternatively
> > the panel containment has to be made part of a layout inside the view.)
>
> yes, PanelView could become a QWidget with a Plasma::View inside it and the
> buttons on either side.
>
> but taking the contentsMargins into consideration when sizing the
> Containment is probably easier and more straightforward.
Ok, I think I'm finally on the right track now. I've just gotten the latest 
svn copy, and to test it out have tried setting the contents margins there 
(with nothing else enabled from the manual hiding code, i.e. a new clean 
checout): setting the contents margins still doesn't affect the containments 
size, so I'll probably have to place the current view in a QWidget (or should 
I look into making Plasma::View take its contents margins into account when 
resizing the containment it shows, i.e. is this actually a plasma bug that 
the contentsmargins don't do anything? Doing this would massively simplify 
the modifications to panelview...).

I'm not really sure how to set about doing the QWidget version though in the 
correct way: panelview is used in quite a few ther classes, so if I were to 
change it into a QWidget I'd need to make quite a few changes to other 
surrounding files. Would it be correct to simply restructure the current 
PanelView, by just taking everything view specific into a separate class 
(PanelInternalView), which is then used (inside the QWidget) as part of the 
new PanelView, making sure all resizing calls etc. go to the new QWidget 
based PanelView, as to ensure good behaviour?

Thanks for the help so far as well :).

-- 
Andrzej JR Hunt -- andrzej (at) ahunt.org


More information about the Plasma-devel mailing list