summaryrefslogtreecommitdiff
path: root/Userland/Applications/PDFViewer/PDFViewerWidget.h
AgeCommit message (Collapse)Author
2023-04-20PDFViewer: Propagate errors from `PDFViewerWidget::initialize_menubar()`Karol Kosek
2023-02-13LibCore: Move Stream-based file into the `Core` namespaceTim Schumacher
2023-01-10PDFViewer: Port to Core::Stream::FileKarol Kosek
2023-01-02Everywhere: Fix badly-formatted includesBen Wiederhake
In 7c5e30daaa615ad3a2ef55222423a747ac0a1227, the focus was "only" on Userland/Libraries/, whereas this commit cleans up the remaining headers in the repo, and any new badly-formatted include.
2022-12-17PDFViewer: Perform standard error handling when opening filesRodrigo Tobar
The previous implementation of open_file had a lambda that was used to inspect the call of ErrorOr-returning calls. This was a non-standard way of doing this though, as the more usual and clearer way is to have an inner function that returns ErrorOr, then handle any incoming errors on the top level function. This commit adds a try_open_file function, where all the logic occurs, and all the failure-producing steps are simplied TRY'ed. The top level open_file function takes that result and does what the lambda previously did: showing a message box with the actual error.
2022-12-16PDFViewer: Add TreeView to communicate rendering errorsRodrigo Tobar
Now that the rendering process communicates all errors upstream, and PDFViewer has a way to tap into those errors as they occur, we can visualise them more neatly. This commit adds a TreeView that we populate with the errors stemming from the rendering process. The TreeView has two levels: at the top sit pages where errors can be found, and under each page we can see the errors that have been found on that page. The TreeView sits below the main PDF rendering.
2022-12-10PDFViewer: Let users change image renderingRodrigo Tobar
A new checkbox in the toolbar now allows users toggle image rendering. A corresponding Config option makes this setting non-volatile. To void clashing with the previous "show_clipping_paths" option when caching a Page, we now use the RenderingPreferences.hash() and the pair_int_hash funcitons to compute a unique key into the page cache map for a given RenderingPreferences and zoom level.
2022-11-25PDFViewer: Let users change clipping paths visibilityRodrigo Tobar
Now that the Renderer accepts preferences, PDFViewer can offer ways for changing these preferences. The first step in this direction is to add a checkbox that allows toggling whether clipping paths are visible or not. A Config item has also been added to remember this setting.
2022-04-04PDFViewer: Add page mode optionMatthew Olsson
2022-01-20PDFViewer: Use FileSystemAccessClient::try_* APIsMustafa Quraish
2022-01-06PDFViewer: Add actions to rotate the displayed PDFMarcus Nilsson
This implements the rotate cw/ccw actions in PDFViewer. Since the rendered pages are stored in a HashMap for caching, the bitmap is wrapped in a struct with the current rotation. This way the caching works as expected while zooming, and a new bitmap is rendered when the page is rotated.
2022-01-06PDFViewer: Add zoom in/out/reset menu actionsMarcus Nilsson
Make PDFViewer::zoom_in() & ::zoom_out() public and add menu and toolbar actions. Also add an action for zoom reset.
2021-09-04PDFViewer: Use FileSystemAccessClient to open filesMustafa Quraish
2021-07-21Userland: Add GUI::Window::add_menu() and use it everywhereAndreas Kling
Applications previously had to create a GUI::Menubar object, add menus to it, and then call GUI::Window::set_menubar(). This patch introduces GUI::Window::add_menu() which creates the menubar automatically and adds items to it. Application code becomes slightly simpler as a result. :^)
2021-05-25PDFViewer: Add a toolbarMatthew Olsson
The toolbar has an option to toggle the sidebar, a number input to set the current page, and two buttons to go up and down by one page
2021-05-25PDFViewer: Add a tab bar with outlines and thumbnailsMatthew Olsson
Outlines are in theory implemented (though I'm having trouble finding a simple PDF with outlines to test it on), and thumbnails are not.
2021-05-18Applications: Add a very simple PDFViewerMatthew Olsson