From 68bc3cb2cb7c75a033a2318ba9057c30e59b63dd Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 12 Jun 2021 07:57:05 +0530 Subject: [PATCH] Main book list: Scroll per pixel rather than per item by default. Can be returned to previous behavior via Preferences->Tweaks->Control behavior of book list. Fixes #1450 (Use Pixel-Based Scrolling in the Main Library View) --- resources/default_tweaks.py | 7 ++++--- src/calibre/gui2/library/views.py | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/resources/default_tweaks.py b/resources/default_tweaks.py index 529fa699f3..1bbc8cd68d 100644 --- a/resources/default_tweaks.py +++ b/resources/default_tweaks.py @@ -382,11 +382,12 @@ cover_trim_fuzz_value = 10 # has the side effect of disabling editing a field using a single click. # Default: open_viewer. # Example: doubleclick_on_library_view = 'do_nothing' -# You can also control whether the book list scrolls horizontal per column or -# per pixel. Default is per column. +# You can also control whether the book list scrolls per item or +# per pixel. Default is per item. doubleclick_on_library_view = 'open_viewer' enter_key_behavior = 'do_nothing' -horizontal_scrolling_per_column = True +horizontal_scrolling_per_column = False +vertical_scrolling_per_row = False #: Language to use when sorting # Setting this tweak will force sorting to use the diff --git a/src/calibre/gui2/library/views.py b/src/calibre/gui2/library/views.py index 6bc5c4c862..5de7833526 100644 --- a/src/calibre/gui2/library/views.py +++ b/src/calibre/gui2/library/views.py @@ -237,6 +237,8 @@ class BooksView(QTableView): # {{{ for wv in self, self.pin_view: if not tweaks['horizontal_scrolling_per_column']: wv.setHorizontalScrollMode(QAbstractItemView.ScrollMode.ScrollPerPixel) + if not tweaks['vertical_scrolling_per_row']: + wv.setVerticalScrollMode(QAbstractItemView.ScrollMode.ScrollPerPixel) wv.setEditTriggers(QAbstractItemView.EditTrigger.EditKeyPressed) tval = tweaks['doubleclick_on_library_view']