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:
+8
-1
@@ -301,8 +301,15 @@ top:
|
||||
|
||||
case SDL_MOUSEWHEEL:
|
||||
lua_pushstring(L, "mousewheel");
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 18)
|
||||
lua_pushnumber(L, e.wheel.preciseY);
|
||||
// Use -x to keep consistency with vertical scrolling values (e.g. shift+scroll)
|
||||
lua_pushnumber(L, -e.wheel.preciseX);
|
||||
#else
|
||||
lua_pushinteger(L, e.wheel.y);
|
||||
return 2;
|
||||
lua_pushinteger(L, -e.wheel.x);
|
||||
#endif
|
||||
return 3;
|
||||
|
||||
default:
|
||||
goto top;
|
||||
|
||||
Reference in New Issue
Block a user