[PATCH] panel placement at the center (or whatever) of the screen

Marco Martin notmart at gmail.com
Mon Mar 31 12:24:26 CEST 2008


On Sunday 30 March 2008, Aaron J. Seigo wrote:
>
> the size, no. constraints on the size need to be externally defined though,
> i think. right now they are set to be the size of the screen. that probably
> needs to be reworked so the view can have something to say about that.
>
> the max size is really all that needs to be communicated in, along with
> wether it should be expanding to fit that size as needed or just always
> that size.

still can't figre out how to do it, the containment would pass the config 
group to the view or what?
don't know, it seems way more natural to me fetching the configuration from 
the containment, if only there was a way for the containment to talk to the 
view (why view() called from the panel containment returns 0 by the way?)

another thing: i think with your proposal we could end up with a broken 
configuration like this: (1024, -0, left) with a screen resolution of 
1024x768 so the panel starts from 1024 end expand to the right, so could 
either become wide 0 pixels or being forcefully moved to the left until there 
is enough room.

i've tought to a slightly different behaviour that both avoids that problems 
and there could be a slick minimalistic configuration interface in the 
future, a mockup of how the (in)famous panel toolbox is here:
http://www.notmart.org/misc/panel-resize-mock.png
we have a new value, i would call it pivot (the white triangle in the mockup) 
that could be either an x coordinate or a double between 0 and 1 (maybe in 
this way it would behave better if the panel is moved from a screen to 
another) a minimum size and a maximum size (green and red signs, they move 
symmetrically when dragged).
the panel would always be placed and expanding according to the pivot value, 
so for instance if the pivot is at the left screen edge the panel will expand 
to the right, if the pivot is at center it would expand equally from the left 
and  the right ad the panel is centered. if the pivot is at one third the 
panel is at one third of the screen and expands one third to the left and two 
thirds to the right.
>
> > > in your patch, there's not chekcing for the panel going off the screen,
> > > so it would be pretty trivial for the user to end up pushing a panel
> > > into another view. this would be particularly easy with vertical
> > > panels.
> >
> > the geometry is intersected with screen geometry but there is the problem
> > that the width (or height) could become 0, but i really don't know how to
> > avoid it, unless there is an hardcoded minimum size.
>
> yes, there should be a minimum size set in PanelContainment.
maybe size of a small icon + margins? or the sum of the minumum size of every 
applet it contain?

Cheers,
Marco Martin


More information about the Panel-devel mailing list