[Cuis-dev] LayoutMorph separation

ken.dickey at whidbey.com ken.dickey at whidbey.com
Mon Aug 26 12:27:38 PDT 2024


I also would like LayoutMorph's to retain #spacing and not add the 
complexity of individual #margins, negative margins et al.

What use cases in Cuis would offset the added complexity of #margin 
calculation?

I like #padding added to #BoxedMorph.

I suspect the #minimumExtent and #morphExtent would continue to refer to 
the exterior edge of a Morph.  Proportional layout also w.r.t. exterior 
edges.  #morphPosition as the upper-left point of the border.

Perhaps a new #contentExtent synthesized from #morphExtent less 2 * 
(#borderWidth + #padding)?

$0.02,
-KenD

> On Mon, Aug 26, 2024 at 9:45 AM Juan Vuletich <juan at cuis.st> wrote:
..
> This is my suggestion:
> - BoxedMorph would have 2 "Borders": Border and Padding
> - Padding is drawn the same as background, i.e. using the morph 'color'
> - Padding behaves as an inner part of the current Border. Any code that 
> needs the boundary between current Border and the "inside" of the morph 
> would now get the boundary between Padding and the area inside it.
> - Margin is only a property that a morph can be queried about, and is 
> part of its LayoutSpec. It is not considered part of the morph at all. 
> It is only used by the containing LayoutMorph. This design is 
> consistent with [1], that states: "Note: The margin property also 
> affects the total space that the box will take up on the page, but the 
> margin is not included in the actual size of the box. The box's total 
> width and height stops at the border."
> 
> So, Bernhard, the difference with your design would be:
> - Margin is moved from LayoutMorph to the inner morphs, but to their 
> LayoutSpec. It is to be used in place of "separation" or "spacing".
> - Padding is moved up to BorderedMorph as you suggest. LayoutMorphs 
> would inherit it. This means that any BorderedMorph could have a 
> non-zero padding of their contents
> - LayoutMorph would no longer have 'separation' and 'margin', neither 
> 'useEdgeSpace' nor a specific 'padding'.
> 
> I think this would cover all the suggested use cases.
> 
> Opinions?

On 2024-08-26 08:16, Mark Volkmann via Cuis-dev wrote:

I like the proposal to add padding to BoxedMorph.

Do I understand correctly that there is a desire to remove separation 
from LayoutMorph? I don't think I like that. I think LayoutMorph needs 
an easy way to specify the gap that should be present between each 
submorph. But I think the gap should not be applied before the first 
submorph and after the last submorph. The new padding in BoxedMorph can 
handle that. Adding a margin to each submorph can achieve the same 
result, but that seems more tedious to apply.

Object Computing, Inc.


More information about the Cuis-dev mailing list