mumu-lhl / eaf-pyqterminal

A terminal written in PyQt6 for the Emacs Application Framework.
GNU General Public License v3.0
47 stars 3 forks source link

The scrolling ratio is adjusted according to the angle delta of scroll event. #10

Closed manateelazycat closed 1 year ago

manateelazycat commented 1 year ago

给 BaseBackend 增加了两个函数: scroll_down 和 scroll_up。

这样滚动的增量会根据用户触摸板的力度来调节, 现在只是 next_page 和 prev_page, 跨度太大, 很容易一滚动就滚过了。

scroll_down 和 scroll_up 的代码和 next_page 和 prev_page 基本上是一样的, 唯一的不同是 ratio 是根据 event.angleDelta().y() 来计算的, 而不是 screen 定义时传入的固定 ratio 参数(默认是 0.5)

mumu-lhl commented 1 year ago

Thanks :)