Re: padding cleanup
- From: Havoc Pennington <hp pobox com>
- To: Behdad Esfahbod <behdad behdad org>
- Cc: gtk-devel-list <gtk-devel-list gnome org>
- Subject: Re: padding cleanup
- Date: Mon, 30 Aug 2010 17:32:07 -0400
Hi,
On Mon, Aug 30, 2010 at 5:00 PM, Behdad Esfahbod <behdad behdad org> wrote:
> Well, I was implicitly suggesting that we take all of CSS margin, border,
> padding and then some.
>
I see. Yeah, that could be cool. I thought about it a little but you
have to figure out what "background" and "border color" mean in a GTK
context; is there a way to set them? do widgets paint them or are they
auto-painted before widget_draw() is invoked? Are they set by apps or
by themes or both?
In my sketchy patch the padding is the part "inside" the widget that
has the widget's background, so it does leave room to add border and
margin and the result would be CSS-alike. While if you renamed padding
to border in this patch you'd be locked in to a non-CSS-like naming.
I think it'd be fairly logical to first mop up padding (as in this
patch) and then do follow-on patches to add border color (border
pattern?), border, and margin. The border and margin patches would
need the same "add extra space in superclass" mechanisms I was talking
about here, but they'd also add the need for a "paint edges in
superclass" mechanism of some kind. I guess even padding creates a
painting question for any children with a non-transparent background
that would logically extend into the padding - are there examples?
I haven't looked at the new CSS-like styling mechanism at all so I
don't know how that would interact.
I do think padding can be cleaned up without having to solve all this
(but maybe solving border and margin is pretty easy, I just haven't
investigated)
Should also seriously think through the use cases for CSS border and
margin. Padding is widely used (via the various ways to set it in
GTK), but there's no current way to do CSS-like border or margin, and
I at least haven't seen people clamoring to be able to make colored
borders or add transparent margins outside those colored borders.
Of course in a "canvas-like"/"HTML-like" completely custom UI, i.e.
nonstandard widgets that ignore the theme, it makes more sense.
Another possibility is that CSS-like border should be something themes
can set, if it'd be useful there.
I don't know. it's a lot of additional questions and new use-cases,
while padding is more of a cleanup.
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]