1. When loading boolean settings we have to explicitly check for the
return of nil from the self.settings:readSetting() function and only
modify the default if the return value is NOT nil.
2. When closing the document we have to reset the settings to defaults,
otherwise their values are re-used on the next open.
3. The messages "Links on page ON/OFF" changed to
"Link underlines ON/OFF" because the old version gave two false
impressions: a) as if the action is pertinent only to the current page
(but in fact it is global for the entire document) and b) that we are
disabling the links whereas we are only disabling the show of underlines
under the links. The new message addresses both issues.
In order to make sure that the message is always visible we should not
show all the decimal places --- one is more than enough. Otherwise the
whole thing is invisible, often enough to be irritating...
This fixes problems with pages full of links where first link
is so big that rest of link shotcuts overlap on page
and size of link shortcuts under different zoom #385
On request of users (dracodoc, kai771 et al.) I have added a new command
`O` which toggles the display (via dimmed box) of the page overlap
areas. This setting is saved on a per-book basis, i.e. is specific to
the book, which is the desired behaviour as one wants dimming on some
books (math, physics, etc) but not others (fiction).
Overloading the function "set full screen refresh count" (Shift-R) with
forcing screen refresh is rather counter-intuitive and inconvenient in
practice, because the InputBox dialog obscures the large part of the
page and when it disappears it is not obvious whether the full page
redraw occurred or not.
Therefore, it is more convenient to have a separate function (bound to
KEY_SPACE as in KPV's filemanager, K3Chess and in most other readers)
that does the full screen refresh.
The call to self:redrawCurrentPage() in UniReader:addBookmark() comes
from the days when this function was causing a "Retrieving TOC..."
message via getTocTitleByPage()->fillToc() codepath. Now that message is
gone so we should kill the redraw as well.
The current step of 25% forward and 20% backward is too big and does not
let us come close enough to the design value of 2.2 for most djvu files.
With 10% step we can get much closer.
After some consideration I believe that it is best to get rid of
"Retrieving TOC..." message altogether on the following grounds:
1. The code in unireader.lua/crereader.lua that has to deal with this
specifically can be removed.
2. The fillToc() is a data manipulation function and ought not to touch
graphical state.
3. The files for which retrieving TOC can take a long time are
_exceptionally_ rare (only two are known to me --- both are my own
editions with detailed morphological tags which require massive
hierarchical TOC for quick navigation)
4. Users are going to be confused when they press Menu for the first
time and see "Retrieving TOC..." staying on the screen until they press
Menu again.
This is a better version of the previous commit, which:
a) makes the code more readable
b) disallows rcountmax values like "6.05", i.e. restricts to integers
only.
Store last globalzoom_mode in self.pan_by_page so we can restore it
to force offsets recalculation on page change
This wasn't quite enough to trigger correct re-panning for page
changes when using fiveway to move in two-column mode, issue #275
I considered adding callback to goto method and than transfering
it through function calls, but this approach (allthough very
questionable) seemed to provide simplier code.
For PDF and DjVu files (but not for crereader) the command handler for
"Back" key can call addJump() in order to avoid losing the top of the
jump history on return. This (addJump()) can cause the TOC to be
retrieved and the message "Retrieving TOC..." to be displayed.
If this happens then we need to redraw the current page after displaying
our own "Already first jump!" message.