Show/hide toolbar when users clicks outside all links in link mode.

In the default mode, when the user clicks on the page or outside of the
page, the toolbar is shown/hidden. This is the default behaviour. If the
toolbar is shown and the user slides the page to view the next page the
toolbar will be hidden automatically to focus on the page content.

When the user clicks on the link button in the toolbar, any links on the
document page are highlighted. In this mode the user cannot show/hide
the toolbar. Instead when the user clicks on the page MuPDF will search
for a link whose area encompasses the clicked position and follow that
link to its link destination. If there is no link at the clicked
position nothing happens.

However if the user at this point slides the page to see the next page
the toolbar is automatically hidden, but the app stays in the link mode.
This means that the link mode can no longer be disabled. Even following
a link to its link destination does not disable link mode so the user
can show the toolbar again.

This commit changes what happens when a user clicks outside of all links
in the link mode. Previously nothing would happen in this situation,
with this commit such a click will cause the toolbar to be shown/hidden,
thus allowing the user to escape the link mode while in link mode.
1 file changed