-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Change PageView to derive from ListView #14252
Change PageView to derive from ListView #14252
Conversation
…lView::Direction` instead of `PageView::Direction`.
…` and `moveChildrenToPosition()`. All move related logic will be integrated into one.
…s.h` in order to use it in other places.
…hat it is disabled.
@neokim But it also means this PR is incomplete. Anyway, if you could open another PR after this one is merged. I think it's ok for me. |
} | ||
} | ||
|
||
Layout* PageView::createPage() | ||
void PageView::addWidgetToPage(Widget *widget, ssize_t pageIdx, bool forceCreate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is a TAB, please change it to 4 spaces. And it happens many places in the header file and the implementation file.
@zilongshanren Ok. I thought the paging scroll threshold can be removed from this PR. I might need to mark it as deprecated APIs. |
@neokim Indicator's initial position is wrong. |
@neokim Due to the implementation, I think it make sense to do this change. But the original PageView API's names indent better than the ListView's API. Like So I suggest we just keep the old API. Thoughts? |
@zilongshanren I'll see the issue about wrong initial position of indicators. Regarding original I agree with you about the naming, but I just wanted to be consistent. I will overload some methods accepting |
@neokim |
@zilongshanren Taking into account the features of the current editor, these changes cloud be merged. |
@neokim |
@zilongshanren I haven't had much time to look into the issues in this PR. I will wrap it up soon like in early next week. Regarding to adding magnetic scrolling strength (the PR you saying I owe 😃), I think it should be considered as an independent one. So after I resolve the issues you mentioned in this PR and you merge it, there will be no remaining things in here. |
[ci rebuild] |
… `PageView::setDirection()` is called before `PageView::setIndicatorEnabled(true)`.
@zilongshanren The issues you mentioned are all resolved. Please review PR again. |
…o avoid compilation error on windows platform
And removed the |
[ci rebuild] |
…listview Change PageView to derive from ListView
@neokim Look forward to your next PR. 😄 |
@zilongshanren Thanks. |
PageView
was derived fromLayout
and it implemented the features of scrolling and item arrangement from scratch. But the features are already there inListView
. So remove those duplicated implementations fromPageView
and make it subclass fromListView
.By this,
PageView
becomes more simplified and maintainable because it considers only paging implementation. And the user experiences regarding scrolling are processed in one place -ScrollView
.One more, page view now has a page indicator which is represented as a list of small circles.