feat(ui): enable pixel-scroll-precision-mode in GUI if available

This commit is contained in:
2022-04-07 01:42:18 +01:00
parent 96f3dca1c9
commit f0f7c53cb3
2 changed files with 31 additions and 0 deletions

View File

@@ -44,6 +44,9 @@
(require 'siren-uniquify)
(require 'siren-which-key)
;; UI
(require 'siren-pixel-scroll)
;; Completion Systems and Interfaces
(require 'siren-vertico)
(require 'siren-orderless)

View File

@@ -0,0 +1,28 @@
;;; siren-pixel-scroll.el --- jimeh's Emacs Siren: pixel-scroll.
;;; Commentary:
;; Enable and configure pixel-scroll-precision-mode on Emacs 29.x and later when
;; running in a window system.
;;; Code:
(when (fboundp 'pixel-scroll-precision-mode)
(use-package pixel-scroll
:straight (:type built-in)
:if window-system
:custom
;; Only affects keyboard-based scrolling when pixel scrolling is enabled.
(scroll-preserve-screen-position 'always)
(scroll-margin 0)
(pixel-scroll-precision-interpolate-page t)
(pixel-scroll-precision-large-scroll-height 40.0)
(pixel-scroll-precision-interpolation-factor 30)
(pixel-scroll-precision-use-momentum (not (eq system-type 'darwin)))
:config
(pixel-scroll-precision-mode +1)))
(provide 'siren-pixel-scroll)
;;; siren-pixel-scroll.el ends here