Re: Patch to GtkPaned.



Christopher James Lahey wrote:
> 
> This patch adds two things to GtkPaned.  Firstly, it handles hiding either
> of the subwidgets well.  If you hide one of the children, it gives all the
> space to the other child and also hides the handle.
> 
> Secondly, it adds a Gtk Argument "quantum".  This is an int which is the
> preferred size of changes for the position of the divider.  For instance,
> this is used in evolution's calendar so that the mini calendar will always
> be approximately a multiple of the size that makes it look best.

There is a problem with the "quantum" code, which you can see in the
calendar - drag either of the handles so that the date navigator (mini calendar)
has the entire width or height. Then drag it back. The width/height of the
date navigator is now not an integer multiple of a single months width/height,
so it looks a bit odd.

I think it would be better to have:

  o a 'base offset', a pixel offset from where you start counting the quanta.
    (this is needed as you often have borders around the repeating parts of the
    widget, as the date navigator does.)

  o a 'quantum size', as you already have. But it could also be -ve to specify
    which side of the paned widget you count the quanta from.

So if you have a base offset of 5 pixels, and a quantum size of -50 pixels,
then the handle can only be placed at the positions: 0, -55, -105, -155 ...
(Where the -ve sign means from the right/bottom edge of the paned container.)

Whether or not you should be able to drag the handle completely to the opposite
edge, even when it does not fall on a quanta 'boundary', I'm not sure.
Maybe that should be an option as well.


The other problem I remember having with the GtkPaned widgets is that you can't
drag the handle right to the edges to hide the child widget completely. This may
be related to the fact that GTK+ can't really handle widgets with a width or height of 0.

It would also be nice to have an option to resize the child widgets as you dragged
the handle, rather than just resizing when you finish the drag.

Damon






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]