single menu checkbox action enlarges or normalizes (shrinks) embedded pdf-viewer #3991
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses following two mutually exclusive menu actions:
As you can see, my personal settings use two shortcuts for enlarging and shrinking the embedded viewer added in the Shortcut config:
But this has the disadvantages that you waste one shortcut and your hand needs to switch between two positions on the keybord for toggling the size of the viewer. If we agree that the pdf-viewer has a normal size which can be enlarged (maximized to the left), a checkbox should be enough to do the job:
As long as there is no embedded pdf-viewer the action is not enabled. So txs needs to know if there is an embedded viewer. This brings me to the next point.
The PR also fixes small issues. Under specific conditions enabling and disabling the action(s) or switching between enlarged and normal size of the viewer works not correctly. The reason for this is the not so well known fact that it is possible creating first a windowed pdf-viewer and then the embedded one. This means that there are two viewers. To do so one needs some changes to the Build Meta and User Commands. In this case an internal PDFDocument list holds two pdf-viewer items. But the code may fail if it relies on the assumption that the embedded viewer (if available) is the first one in the list. It is necessary to search through the list.