Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Viewer

Notices

Reply
 
Thread Tools Search this Thread
Old 03-22-2023, 03:12 PM   #1
bookfighter
Junior Member
bookfighter began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2023
Device: none
Post vertical scrolling through toc

Dear user of digital books, dear calibre user, dear calibre author,
I think it would it be a very nice tiny feature if calibre's viewer (Linux version) would jump to the next TOC item of the book when scrolling vertically with the mouse wheel. What do you think?
Maybe I can bring in my vanishing small programming skills into this huge project by implanting this feature.
Best regards and honor, good reading
Markus
bookfighter is offline   Reply With Quote
Old 03-22-2023, 09:45 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
There are already keyboard shortcuts to do this. Ctrl+pagedown IIRC. The mouse wheel is used for scrolling pages.
kovidgoyal is online now   Reply With Quote
Old 03-24-2023, 01:32 PM   #3
bookfighter
Junior Member
bookfighter began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2023
Device: none
Post scrolling through toc by mouse

Dear Kovid,
Thank you for your reply, and the amazing work on calibre.
I've already noticed the scrolling ability through toc by PgDown/PgDown Key, and would still prefer to use the mouse wheel for this.
I guess programmatically, this feature could be easily implemented to the wheelevent handler of the QtWebEngineWidget of the ebook-viewer and differentiate angleDelta in x- and y-component accordingly horizontal and vertical scrolling. This should not interfere with the common one dimensional usage of the mouse wheel. Rather, it would add some nice functionality for the viewer, IMHO.
Hope that I have not bothered you or others by this proposal/idea.
Best regards
Bookfighter
bookfighter is offline   Reply With Quote
Old 03-25-2023, 12:31 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
As I said scrolling vertically is already used for turning pages. Scrolling horizontally is available. And the viewer code is platform independent, it work sin browsers as well, so its not implemented using Qt, the relevant code would be in paged_mode.pyj, see the onwheel function.
kovidgoyal is online now   Reply With Quote
Old 03-27-2023, 01:04 PM   #5
bookfighter
Junior Member
bookfighter began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2023
Device: none
toc-item-scrolling

Ok, scrolling with mouse wheel in y-direction works indeed fine. (Maybe in n-column reading views, it should scroll also in n-column steps, as classical scrolling with classical paper pages does.)
My proposal was to add scrolling in x-direction (for some newer mice) in such a way that one can scroll through the TOC, and lands at the beginning of each item in the viewer.
According to Qt-Documentation, the rotation of the mouse wheel can be discerned by angleDelta of the wheel event:
def wheelEvent(self,e):
print("x: ", e.angleDelta().x())
print("y: ", e.angleDelta().y())
I've just implemented this via plain PyQt6, for testing purpose, and looked at your Handlewheel function in paged_mode.pyj. I just would add
if deltaX:
toc-item+= sgn(deltaX)
showTocItem(toc-item)
but unfortunately, I'm still not able to get the cmake tool to work properly for building and testing this of my own. But I will try. Maybe other users/programmers can help here.
For usual one-dimensional mouse wheels, one could use this toc-item-scrolling when hovering over the TOC and using the common mouse wheel.
bookfighter is offline   Reply With Quote
Old 03-27-2023, 01:44 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by bookfighter View Post
Ok, scrolling with mouse wheel in y-direction works indeed fine. (Maybe in n-column reading views, it should scroll also in n-column steps, as classical scrolling with classical paper pages does.)
That is settable in the viewer prefernces under scrolling behavior.

And you dont need to build calibre to make changes to its code. https://manual.calibre-ebook.com/develop.html
kovidgoyal is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Vertical Scrolling aristide Marvin 2 01-23-2019 08:05 PM
Vertical Scrolling Ricky D'Angelo Kindle Fire 6 12-05-2018 10:40 PM
Vertical scrolling vs40 Marvin 1 10-22-2015 12:58 PM
Vertical scrolling... Holx Marvin 6 07-17-2014 04:35 PM
Touch Vertical scrolling using app holgalee Nook Developer's Corner 3 06-18-2012 09:29 AM


All times are GMT -4. The time now is 04:17 AM.


MobileRead.com is a privately owned, operated and funded community.