mirror of
https://github.com/enso-org/enso.git
synced 2024-12-20 04:11:35 +03:00
71b3a9f40a
[Task link](https://www.pivotaltracker.com/story/show/182194574). [ci no changelog needed] This PR implements a new selection box that will replace an old (not really working) one in the component browser. The old selection box wasn't working well with the headers of the component groups, so we were forced to make a much harder implementation. The new implementation duplicates some visual components and places them in a separate layer. Then, a rectangular mask cuts off everything that is not "selected". This way: - We have more control over what the selected entries should look like. - We can easily support the multi-layer structure of the component groups with headers. - We avoid problems with nested masks that our renderer doesn't support at the moment. To be more precise, we duplicate the following: - Background of the component group becomes the "fill" of the selection. - Entries text and icons - we can alter them easily. - Header background and header text. By placing them in separate scene layers we ensure correct rendering order. https://user-images.githubusercontent.com/6566674/173657899-1067f538-4329-44f9-9dc2-78c8a4708b5a.mp4 # Important Notes - This PR implements the base of our future selection mechanism, selecting entries with a mouse and keyboard still has several issues that will be fixed in the future tasks. - The scrolling behavior will also be improved in future tasks. Right we only restrict the selection box position so that it never leaves the borders of the component group. - I added a new function to `add` shapes to new layers in a non-exclusive way (we had only `add_exclusive`) before. I have no idea how we didn't use this feature before even though we mention it a lot in the docs. - The demo scene restricts the position of the selection box for one-column component groups but does not for the wide component group. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |