Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: better relative bubble positioning #19

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

Termtime
Copy link
Contributor

@Termtime Termtime commented Oct 14, 2021

Fixes #16
This also supersedes part of the effort that #11 was doing, but I think a bit better, instead of declaring manually by how much you want the container to expand, we just let it automatically use the remainder of the parent's size in the direction that has the most space.

For this I added a new system that allows the expansion of the slide's child beyond the highlighted area, it is heavily assisted by an Align widget (or in the case of the example the SpeechBubble's NipLocation which sets an alignment). And its not possible to center the slide in the highlighted area when you are totally inside one of the quadrants of the screen, the only place where we kinda expand while keeping it centered is when we are not inside only one quadrant (also known as being in the center quadrant of the screen). I added a bunch of private helper functions inside RelativeBubbleSlide

To enable it you must set enableExtraSpace: true when declaring the RelativeBubbleSlide, this way it will be an opt-in change for previous users, and the previous system is still preserved and used by default.

Also modified the example to add showcases of the new system and how it looks.

LMK what you think @Skyost

Also, something that would be a breaking change is that previously that when you set direction: AxisDirection.right it would actually put the bubbleSlide to the left and vice-versa, I have fixed this, so it could break someone's BubbleShowcase, I would suggest moving a major version for the next release.

@Termtime Termtime marked this pull request as draft October 14, 2021 23:46
@Skyost Skyost self-assigned this Oct 24, 2021
@Skyost
Copy link
Owner

Skyost commented Oct 24, 2021

LMK what you think @Skyost

Seems like a great idea, thanks for this PR 👍

@Termtime
Copy link
Contributor Author

Great! I might finish this in the next week or two, I will tag you when I am done and open for review

@Skyost
Copy link
Owner

Skyost commented Oct 27, 2021

Fine 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BubbleShowcase cannot exceed highlighted widget's dimensions
2 participants