Created
October 19, 2022 13:27
-
-
Save M4he/4f6222e2524a15bca8a64ae9c2d09ea7 to your computer and use it in GitHub Desktop.
PCManFM-Qt patch for making default scrolling slow (row-by-row) and only fast with Shift key (like Dolphin, the reverse of PCManFM-Qt's default behavior)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- src/folderview.cpp.orig 2022-10-19 15:22:15.688067732 +0200 | |
+++ src/folderview.cpp 2022-10-19 15:10:59.396065442 +0200 | |
@@ -1592,8 +1592,8 @@ | |
return true; | |
} | |
} | |
- // row-by-row scrolling when Shift is pressed | |
- if((QApplication::keyboardModifiers() & Qt::ShiftModifier) | |
+ // row-by-row scrolling when Shift is NOT pressed | |
+ if (!(QApplication::keyboardModifiers() & Qt::ShiftModifier) | |
&& (mode == CompactMode || mode == DetailedListMode)) // other modes have smooth scroling | |
{ | |
QScrollBar *sbar = (mode == CompactMode ? view->horizontalScrollBar() | |
@@ -1656,7 +1656,7 @@ | |
if(QScrollBar* vbar = view->verticalScrollBar()) { | |
// keep track of the wheel event for smooth scrolling | |
int delta = static_cast<QWheelEvent*>(event)->angleDelta().y(); | |
- if(QApplication::keyboardModifiers() & Qt::ShiftModifier) { | |
+ if (!(QApplication::keyboardModifiers() & Qt::ShiftModifier)) { | |
delta /= QApplication::wheelScrollLines(); // row-by-row scrolling | |
} | |
if((delta > 0 && vbar->value() == vbar->minimum()) || (delta < 0 && vbar->value() == vbar->maximum())) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's a quick rundown on how to apply this on Debian 11 for reference: