This patch expands on Krita's current 'Kinetic Scrolling' option originally added in the D8015 patch submitted by @poke1024. Co-Authored by Emmet.
This patch takes the concept of Kinetic Scrolling and applies it uniformly across Krita's user interface, where applicable. To do so, we've created a new KisKineticScrolling namespace that encompasses most of the behavior of kinetic scrolling in a single place, which allows for adding consistent kinetic scrolling behavior to any UI element with just a few function calls. Using the new namespace we were able to easily add kinetic scrolling to all of Krita's scrollable user interface elements including dockers, the toolbox, the brush preset selector, palettes, animation timeline, etc. Because all of these elements share the same code path, they all use the same user-configured settings. The namespace also has a couple of utility functions, including a cursor updater to unify the visual feedback.
We've also taken the time to make some small changes to the kinetic scrolling options (Configure Krita > General > Tools > Kinetic Scrolling). Now all of the kinetic scrolling options are inside a checkable QGroupBox which is used to enable or disable the feature. As such, we have removed 'disabled' from the dropdown menu, which is used to configure which input is used to scroll. We've replaced the sensitivity combobox with a KisSliderSpinBox (from 0 to 100). We've changed "Show Scrollbars" to "Hide Scrollbars" (unchecked by default).
Finally, we've added an option to use middle click for kinetic scrolling and have made that the default for multiple reasons. The foremost reason being that middle click is already used for panning in Krita's canvas view and thus creates a uniform behavior across all of krita's ui. Secondly, middle click is basically unused throughout most of krita's UI while left and right click are used for other things. The user can bind middle click to their tablet pen. The main idea is that middle click and drag becomes a kind of standard way to "pan" krita's various UI elements which improves control and add coherency to Krita's ui.
Code Note: In order to expose the KisKineticScroller namespace to various parts of the code, I'm currently doing some ugly stuff with CMakeLists in order to get access to the namespace in other modules. If there's a better way to do this, let me know because I'm still relatively new to CMake.