Re: padding cleanup


On Sat, Sep 4, 2010 at 1:40 PM, Thomas Wood <thos gnome org> wrote:
> It might be worth re-using the CSS box model¹ nomenclature here to avoid
> confusion. In the CSS box model:
>      *  "margin": extra spacing around the element, outside of the
>        border.
>      *  "border": the width of the frame drawn around an element.
>      *  "padding": the spacing between the content area and the border.
> The border property may not be strictly necessary, although might be
> useful for themes. Any other spacing between elements inside a widgets
> could be referred to with "spacing" properties.

It's fairly unclear and ambiguous how to apply this to GTK. There
isn't a frame drawn around elements. Prior to adding a patch like the
one I'm proposing, there also is no distance between content area and
border. Most of what's called "padding" in gtk now is probably
"margin" - except that it "goes with" the container and not the

If we add just one kind of extra space around a widget, and it would
not be included in the allocation the widget gets (which is true in
the implementation I proposed most recently), then I guess the widget
won't draw its background in this space. And there won't be any color
or anything there. So maybe what I'm suggesting we add is best called

In the original sketchy patch I posted, the size allocation included
the padding, so that was really padding rather than margin.

Border I think we only have if we add a border-color or border-pattern
concept. Absent some way to _paint_ the border, we don't have CSS

Confusing all this, is whether some of them are style props vs.
programmer-provided; or are some programmer-provided then adjusted by

Anyway I think the programmer-provided blank space around a widget
(what most containers call padding today) should maybe be "margin" if
it does not get included in the widget's allocation, and "padding" if
it does.


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