Open LinqLover opened 1 year ago
This issue can be observed in vita in Morphic-ct.2051 (inbox) where I needed to add one "redundant" height: 0
send in KeyboardExerciser>>#clear
.
That's expected. A shrink-wrapped morph without any submorphs will keep its size. It will not shrink to 0.
See comment in Morph >> #doLayoutIn:
.
This behavior is probably caused by the "0) Quick return." check in Morph>>#doLayoutIn:.
There you have even found the commentary on the expected behavior ;-) ... so, why this issue?
Well, then I had (or still have) a different understanding of #shrinkWrap
. :-) The comment in #hResizing:
et al. says:
resize to fit children
And "shrink wrap" to me indicates "clearly "if there are n children, shrink to their (total) size, if there is 1 child, shrink to its size, if there are 0 children, shrink to 0". Why should I need to do this manually? :-)
Think of interactive, drag-and-drop interfaces. The user would not be able to re-insert a thing into a zero-width container.
Wouldn't that be a case for #minimumWidth
or similar? If your dnd container had a tiny label/decoration at its top, dnd would still be very inconvenient ...
Please sketch the scenario you are actually working with. No toy example. :-)
Took me a while to find the motivating situation for this one-year-old issue from my change logs, but I finally found it:
KeyboardExerciser>>#clear ct 11/19/2022 20:12 (https://lists.squeakfoundation.org/archives/list/squeak-dev%40lists.squeakfoundation.org/message/GR7PHVTIVXGLXXWTYVX22JIK5E3LQWYP/#:~:text=keyboardexerciser%3E%3Eclear)
That height: 0
there should not be necessary (but if you comment it out, the tool does not shrink after changing the keyboard mode until you press the next key).
Minimal example:
Actually, I even wonder why the freshly initialized morph does not have the height
0
... Is this a bug or expected behavior?This behavior is probably caused by the "0) Quick return." check in
Morph>>#doLayoutIn:
.