Manual Hiding of Plasma Panel (desktop shell)
Aaron J. Seigo
aseigo at kde.org
Mon Mar 8 01:59:27 CET 2010
On March 7, 2010, Andrzej JR Hunt wrote:
> painting of the panel, places the cashew on it, has the applet placed on
> it. The panelView is responsible for hiding/showing this etc: the panel is
> inside the view, and until now completely fills it.
coorect.
> - Up until now I have only really added the buttons on top of the view. and
> have tried to get the panel (containment) to leave extra blank spaces so
> that the buttons have space (using setContentMargins()). This method
> however isn't particularly good because it places assumptions on the
> containment about its margins which shouldn't be made as not to break
> anything. (This method also doesn't work because of the cashew not
> moving...)
correct
> - 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.
> - Putting the buttons as part of the containment -- but only the panel
> containment class, not the overall plasma:containment class -- (but leaving
> the hiding functions in the view) still isn't OK?
yes, because it won't work. there is no "the panel containment class". there
can be any number of panel containment plugins and there is no guarantee that
the view will have any sort of hiding semantics at all so trying to build some
assumptions between the Containment and the View in this way is completely
broken.
you need to stop thinking about plasma-desktop as the what plasma is and start
thinking about plasma as a (nearly) assumption-free system for creating
primary user interfaces. the goal of libplasma is not to create plasma-
desktop. plasma-desktop is just one implementation of what's possible with
it.
this means that ANY coupling between the scene components and the views that
represents an assumption of usage is broken.
> > you don't have to disable them, just paint -over- them, on compositing
> > but replacing wat that was already painted
>
> That isn't too difficult in itself, but if the cashew is showing I need to
> paint more of it on, since when the panel end is curved, the curve cuts off
> part of the cashew (it gets placed at the very end of the panel), but the
> panel now has the curve further away,
the hide button does not need to be inside the curve. in fact, for
implementation reasons, i'd say "don't bother" and put it (visually) outside
the end of the panel. problem solved.
(and it's the toolbox, not the cashew)
--
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA EE75 D6B7 2EB1 A7F1 DB43
KDE core developer sponsored by Qt Development Frameworks
More information about the Plasma-devel
mailing list