added alt+scrollwheel -> horizontal scrollbar

This commit is contained in:
SwissalpS 2020-06-28 12:18:57 +02:00
parent 094cf0cc2c
commit aa70d3f7e8
1 changed files with 6 additions and 1 deletions

View File

@ -3,6 +3,7 @@ local config = require "core.config"
local style = require "core.style"
local common = require "core.common"
local Object = require "core.object"
local keymap = require "core.keymap"
local View = Object:extend()
@ -97,7 +98,11 @@ end
function View:on_mouse_wheel(y)
if self.scrollable then
self.scroll.to.y = self.scroll.to.y + y * -config.mouse_wheel_scroll
if keymap.modkeys['alt'] then
self.scroll.to.x = self.scroll.to.x + y * -config.mouse_wheel_scroll
else
self.scroll.to.y = self.scroll.to.y + y * -config.mouse_wheel_scroll
end
end
end