layout rules

54 views
Skip to first unread message

Johnvey Hwang

unread,
May 12, 2011, 10:56:55 PM5/12/11
to ukijs
I just picked up Uki (v0.3.8) today and do like a lot of the
architecture (the Mail demo app is quite impressive). One aspect that
I think could be improved is the layout specification for views: the
rect&anchor model ends up requiring a lot of nudging to account for
various display elements, resulting in setting widths like
'897' (instead of 900) or '791' because there are 2 dividers somewhere
to account for.

Have you considered a model like Sproutcore's, where you specify
layout via something like:

layout: { top: 0, left: 0, bottom: 0, right: 0 }

to render a container that simply fills to its parent.

Or:

layout: { top: 0, left: 0, bottom: 25 , right: 0 }

to render the same container that fills to its parent, but have 25px
of margin on the bottom.

Or:

layout: { top: 15, left: 15, width: 40, height: 24 }

to render a 40x24 button that is offset by 15,15.

Or:

layout: { top: 15, right: 15, width: 40, height: 24 }

to render the same button but anchored by its NE corner to to NE
corner of its parent.

Thoughts?

- J

Johan Rydberg

unread,
May 13, 2011, 1:28:35 AM5/13/11
to uk...@googlegroups.com
I think this is the model for 0.4.
Reply all
Reply to author
Forward
0 new messages