When torrent size is smaller than the image width, bytes per pixel was
set to zero and code was crashing. Set it to -1 instead, as we do when
image is empty. This will disable highliting, but our algorithm does not
work in this case anyway.
Computations for detailed tooltips are not protected against unavailable
metadata, that leads to asserts or crashes. But since those tooltips are
useless in this case, do not show them at all. Inform user that detailed
tooltip becomes available once torrent metadata are fetched.
If tooltip text contains an empty HTML body, Qt still shows it as an
empty rectangle. Thus, output HTML tags only if we are within the
image region, and return true empty string if we are at the borders.
In addition to the current tooltip, which shows color legend, if user
holds the Shift key during hovering we show another tooltip which
contains a table of contents for the piece under the moue cursor. The
table lists file sizes and names. If the cursor points to a part of a
file which spans several pieces, those pieces are highlighted.