ui: dynamic page allocation to gtk grid #721
Open
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.
Implements #719 to resolve in #449, #365, #253, #200, and #65
Tested on the ARM reference manual (15,000 pages) https://developer.arm.com/documentation/ddi0487/latest, and Intel manual (5000 pages) https://developer.arm.com/documentation/ddi0487/latest, and doesn't crash when zooming in to either document.
I'm not sure if the document widget should stay as a GTK widgt or change to a normal struct, I'm fine with either.
Care needs to be taken when manually setting the value of the ui viewport, since the document widget changes the grid.
zathura_document_widget_[set_ratio_from_value|get_ratio]
functions wrapzathura_adjustment_[set_ratio_from_value|get_ratio]
functions to handle the conversion from document ratio to widget ratio.The canvas size chosen is 32,767 which is the max cairo canvas height (perhaps this can be increased but I don't know how much cairo can handle).
zathura_document_widget_render
updates the pages in the grid when the current page is within 1 page of the current pages shown. There's probably a smarter way to handle this as it doesn't do to well with scrolling in zoomed out documents.