This repository was archived by the owner on Oct 13, 2021. It is now read-only.
Add ZBox, an implementation of stacked / modal Widgets#109
Open
cceckman wants to merge 19 commits intomarcusolsson:masterfrom
Open
Add ZBox, an implementation of stacked / modal Widgets#109cceckman wants to merge 19 commits intomarcusolsson:masterfrom
cceckman wants to merge 19 commits intomarcusolsson:masterfrom
Conversation
This reverts commit 171ef32. It has some calls to methods that don't yet exist- making Box's fill behavior optional. This allows it to be used for layout as well as styling.
This shows the same bug that I found previously- that word-wrapped labels don't get resized properly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 toHBoxandVBox, except that instead of constraining "same width" or "same height", it constrains "same size", and forces overwriting.The
AppendAPI 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.Drawdelegates to all theDrawmethods of its contents, serially. I haven't checked to see if this causes flickering / tearing / etc- that's a detail oftcellI 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
centerpublicly-func Center(w Widget) Widget- if this is the approach we want to take?)