pos is juts a simple frac between 0 and 1. The difficulty in getting progress in the chapter is that you have to first know the chapter start and end limits (in the general case a chapter does not necessarily have to be in a self contained html file). You can get the limits the same way the ToC code in the viewer knows which entry to highlight.
However, before you go any further, you should know that the viewer is in maintenance mode. The library it is based on (Qt WebKit) has been discontinued so it is going to be be replaced by a new codebase -- the new codebase is currently being developed for the in-browser viewer for calibre 3.0. When that is completed, it will be used to switch the desktop viewer over to use Qt WebEngine instead of Qt WebKit.
|