Overlay support and PickList widget#444
Merged
Merged
Conversation
The `Overlay` struct is now `overlay::Element`.
Member
Author
|
@zero-systems Yes, I haven't merged the PR precisely because I need to adress that first!
You should not need to do anything special. The geometry produced by a The overlay support I describe here refers to the superposition of interactive content on top of other interactive elements. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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 PR introduces the foundations for overlay support and a
PickListwidget.A new
overlaymethod has been added to theWidgettrait. A widget can choose to implement this method to display interactive content on top of other widgets by returning an implementor of the newOverlaytrait.While this new
Overlaytrait is very similar toWidget, the layout logic of anOverlayworks with absolute window coordinates, instead of some relative limits. This can be leveraged to smartly overlay content based on the absolute position of a widget:Additionally, a
PickListwidget has been implemented to showcase the overlay support. This widget is equivalent to a "dropdown list" or a<select>element on the Web.The
PickListwidget uses aMenuas its overlay, which represents a list of selectable options. Currently,Menuis the only built-in type implementing the newOverlaytrait. However, now that the foundations are laid out, I believe we should be able to implement different kinds of overlays relatively easily.It is important to note that the current overlay support has some limitations and, therefore, it is not equivalent to full layering support (see #30). Specifically, the
Overlaytrait does not currently allow nesting, which means we cannot satisfy some use cases yet (like displaying a modal with aPickListinside). We will need to improve our rendering pipeline—specially text—before we are able to remove these limitations. In any case, I believe this is the first step in the right direction and the current implementation, while far from complete, already brings a lot of value.Finally, and as always, I have created a new
pick_listexample to showcase the newPickListwidget and also added a preset selector to thegame_of_lifeexample.Closes #235.