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

Export table scrolling methods #2317

Merged
merged 4 commits into from Jul 12, 2021
Merged

Conversation

nealmcc
Copy link
Contributor

@nealmcc nealmcc commented Jul 10, 2021

Description:

This PR adds the following public methods to widget.Table:

  • ScrollTo(id)
  • ScrollToEnd()
  • ScrollToStart()

Fixes #1892

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.
  • Public APIs match existing style.

I'm not certain about the public API style. The issue mentioned creating ScrollToTop() and ScrollToBottom() but a table is 2D, so I went with ScrollToStart() and ScrollToEnd(). Any thoughts on this?

I figured I'd get some feedback on this before working on scrolling for widget.Tree

 - ScrollTo, ScrollToEnd, ScrollToStart
 - addresses fyne-io#1892
@andydotxyz
Copy link
Member

Is End and Start best? It seems unlikely that bottom-right is more useful than bottom left? How about top and bottom like list with possible leading and trailing as well?

@nealmcc
Copy link
Contributor Author

nealmcc commented Jul 10, 2021

So, what would leading and trailing do? scroll all the way left and all the way right, without changing the vertical offset?

@andydotxyz
Copy link
Member

Yes I think so, if that makes sense?

Copy link
Member

@andydotxyz andydotxyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great addition, just a few comments on the exact functionality and comment/variable style

widget/table.go Outdated Show resolved Hide resolved
widget/table.go Show resolved Hide resolved
widget/table.go Outdated Show resolved Hide resolved
widget/table_test.go Show resolved Hide resolved
widget/table_test.go Outdated Show resolved Hide resolved
widget/table_test.go Outdated Show resolved Hide resolved
widget/table_test.go Outdated Show resolved Hide resolved
@nealmcc nealmcc requested a review from andydotxyz July 12, 2021 21:19
Copy link
Member

@andydotxyz andydotxyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff, thanks again :)

@andydotxyz andydotxyz merged commit fe030a2 into fyne-io:develop Jul 12, 2021
@nealmcc nealmcc deleted the feature/scrollTable branch July 13, 2021 08:43
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.

None yet

2 participants