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:
@@ -1053,9 +1053,13 @@ function StatusView:on_mouse_released(button, x, y)
|
||||
end
|
||||
|
||||
|
||||
function StatusView:on_mouse_wheel(y)
|
||||
function StatusView:on_mouse_wheel(y, x)
|
||||
if not self.visible then return end
|
||||
self:drag_panel(self.hovered_panel, y * self.left_width / 10)
|
||||
if x ~= 0 then
|
||||
self:drag_panel(self.hovered_panel, x * self.left_width / 10)
|
||||
else
|
||||
self:drag_panel(self.hovered_panel, y * self.left_width / 10)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user