thSoft / eclipse-commons

Eclipse Commons

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PdfPageCountContribution size

nittka opened this issue · comments

PdfViewToolbarManager$PageCountContribution shows the number of total pages, but the label size is not updated. So if you initially open a score with 1 page only and then switch to one with 20 pages, you only see 1/2 instead of 1/20.
Using label.pack() after setting the text within the update method, the size is recalculated, but I was not able to get the toolbar itself to be rerendered, so that the new size is actually used.

The last commit (based on https://www.eclipse.org/forums/index.php?t=msg&th=160433&goto=758287&#msg_758287) works for me. Please verify whether it works also for you.

Almost - the vertical alignment of the page count is broken (now placed too high, not centered). But the width is finally is updated. Overriding isDynamic was what I was always missing. I'll create a PR fixing the previous version (label + container) later on.