This repository has been archived by the owner on Oct 13, 2021. It is now read-only.
Add ZBox, an implementation of stacked / modal Widgets #109
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an alternative to #103: a different way to have Widgets that overlay each other.
It defines a new
ZBox
, which is analogous toHBox
andVBox
, except that instead of constraining "same width" or "same height", it constrains "same size", and forces overwriting.The
Append
API is slightly different, as well; rather than providing access to indices, it returns a "remover" function that can remove the just-added widget. This feels to me like an intuitive way to handle multi-dialog closure:since indices may change if the dialogs aren't removed in stack order.
Some main differences from #103:
Widget
, so it can be used for not-the-entire-view dialogs as well- e.g. rendering an underlying view invisible without overwriting the whole screen.Draw
delegates to all theDraw
methods of its contents, serially. I haven't checked to see if this causes flickering / tearing / etc- that's a detail oftcell
I haven't dug in to.It follows #105, since it makes "box with transparent background" an ~easy way to do layout. (Maybe it's worth extracting
center
publicly-func Center(w Widget) Widget
- if this is the approach we want to take?)