1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:37:34 +00:00

PDFViewer: Add zoom in/out/reset menu actions

Make PDFViewer::zoom_in() & ::zoom_out() public and add menu and toolbar
actions. Also add an action for zoom reset.
This commit is contained in:
Marcus Nilsson 2022-01-02 21:58:51 +01:00 committed by Andreas Kling
parent 45085122ee
commit 3af71c406d
4 changed files with 50 additions and 8 deletions

View file

@ -49,6 +49,10 @@ public:
Function<void(u32 new_page)> on_page_change;
void zoom_in();
void zoom_out();
void reset_zoom();
protected:
PDFViewer();
@ -60,9 +64,6 @@ private:
RefPtr<Gfx::Bitmap> get_rendered_page(u32 index);
RefPtr<Gfx::Bitmap> render_page(const PDF::Page&);
void zoom_in();
void zoom_out();
RefPtr<PDF::Document> m_document;
u32 m_current_page_index { 0 };
Vector<HashMap<u32, RefPtr<Gfx::Bitmap>>> m_rendered_page_list;