Refactor scrollbar into its own file (#1124)
* 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 commit is contained in:
@@ -195,10 +195,10 @@ end
|
||||
|
||||
function TreeView:on_mouse_moved(px, py, ...)
|
||||
if not self.visible then return end
|
||||
TreeView.super.on_mouse_moved(self, px, py, ...)
|
||||
self.cursor_pos.x = px
|
||||
self.cursor_pos.y = py
|
||||
if self.dragging_scrollbar then
|
||||
if TreeView.super.on_mouse_moved(self, px, py, ...) then
|
||||
-- mouse movement handled by the View (scrollbar)
|
||||
self.hovered_item = nil
|
||||
return
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user