-
Notifications
You must be signed in to change notification settings - Fork 236
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
Refactor scrollbar into its own file #1124
Conversation
Gave it a test run and so far:
|
b02df8b
to
5f26836
Compare
Fixed copy-paste mistake. Please test again. |
Tested again, looking and working pretty good now :), also pretty interesting feature the new alignment, looks pretty handy for languages written from right to left on a future that lite-xl could support that, for reference here is how it looks the opposite alignment for those peeking at this PR: With latest correction I haven't found any faults. I tested plugins which the projectsearch told me do scrollbar stuff and this is what I have found:
|
787dd08
to
35776ab
Compare
35776ab
to
1666bab
Compare
This implementation looks nice and clean and I have already added support to https://github.com/lite-xl/lite-xl-widgets on a local branch without any major issues. Now only minimap needs to be fixed which may be done over the course of the week by @adamdharrison or @Guldoman (whoever does it first) and as Guldo pointed add support for new horizontal scrollbar on the |
* Move scrollbar to its own file * Don't call `Scrollbar` functions if `View` is not scrollable * Allow horizontal scrolling in `Scrollbar` * Add horizontal scrollbar to `View` * Add `root:horizontal-scroll` command with `shift+wheel` keymap * Prioritize vertical scrollbar hover * Don't send mouse movement to vertical scrollbar when dragging horizontal one * Fix clicking on horizontal scrollbar track * Implement `start` scrollbar alignment * Add documentation to `Scrollbar` * Make `DocView` infinitely scrollable horizontally * Handle horizontal scroll SDL event
This PR moves the scrollbar code to its own file.
The scrollbar can be arranged vertically or horizontally, at the start or the end of a
View
.This PR also makes the
DocView
infinitely scrollable horizontally. Actual accurate scrolling will come in the future.To test how the scrollbar would behave in the
DocView
, change the return value ofDocView:get_h_scrollable_size
to something like5000
.Plugins that touch the scrollbar will likely need to be updated.
Fixes #950.
Edit:
This also slightly changes how the scrollbars behave in regards to click+drag on the track, as well as how the offset to the initial drag position is kept when going over the position limits (try dragging the thumb all the way to the top and over, then going back to the middle of the view, compare between
master
and this PR).