Re: padding cleanup


On Sun, Aug 29, 2010 at 7:02 PM, Havoc Pennington <hp pobox com> wrote:
> - one approach: put padding stuff in the size_request / size_allocate
> *wrappers* in the same way that size groups and set_size_request are
> handled. all widgets just work without modifications, is the big plus
> of this.

Implementation-wise, I'm kind of leaning toward this, plus
virtualizing "get the extra padding for request" and "remove the extra
padding for allocation" and calling those virtual methods from the

So in this world, GtkSizeRequest, size_request, size_allocate are all
unchanged. GtkWidget has "modify request" / "modify allocation"
virtual functions. After size requesting the widget, those virtual
functions might be called from _gtk_size_group_bump_requisition where
we currently use aux_info->width,height. In fact, the aux_info forced
size request could now be implemented inside gtkwidget.c by these
vfuncs, so AuxInfo could be completely privatized.

This would allow GtkWidget::padding-*, GtkWidget::h,valign,
GtkMisc::scale,pad, and GtkContainer::border_width to all be
implemented transparently (i.e. without subclasses having to do
anything in their request/allocate methods). Making Misc and Container
transparent would be incompatible changes (breaking subclasses)
however, so maybe we don't want to do that.


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