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

Add the ViewportHeader widget #2312

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Conversation

xarvic
Copy link
Collaborator

@xarvic xarvic commented Dec 18, 2022

Add functionality based on the ViewContextChanged lifecycle event, which provides widgets with information about the viewport.

The ViewportHeader widget has a header child and a content child and moves the header over the content if this helps to keep the header inside the viewport. This way the header widget sticks to the border of the viewport. For an example this is useful if you have multiple large widgets in a scroll view and always want to know which element you are currently looking at. ScrollToView request also work, since the ViewportHeader widget intercept and transforms the requests.

The Align widget gains the ability to only consider its visible part for aligning its child.

@xStrom
Copy link
Member

xStrom commented Jan 12, 2023

Please rebase on master so we can pass the CI without unrelated clippy errors. Also please run cargo fmt.

Additionally, please give a short description of what the purpose of the ViewportHeader widget is. I see that there is an example, which is excellent. I'll check that out when we pass CI.

@xStrom xStrom added the S-waiting-on-author waits for changes from the submitter label Jan 12, 2023
fix clippy suggestions
@xarvic
Copy link
Collaborator Author

xarvic commented Jan 21, 2023

@xStrom i edited the description of the ViewportHeader widget and also improved the example.

@xarvic xarvic added S-needs-review waits for review and removed S-waiting-on-author waits for changes from the submitter labels Jan 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-needs-review waits for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants