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

PDFViewer: Add a toolbar

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
This commit is contained in:
Matthew Olsson 2021-05-23 22:34:44 -07:00 committed by Ali Mohammad Pur
parent cea7dbce42
commit cf3eb27108
6 changed files with 186 additions and 10 deletions

View file

@ -6,9 +6,11 @@
#pragma once
#include "NumericInput.h"
#include "PDFViewer.h"
#include "SidebarWidget.h"
#include <LibGUI/Action.h>
#include <LibGUI/TextBox.h>
#include <LibGUI/Widget.h>
class PDFViewer;
@ -19,16 +21,20 @@ class PDFViewerWidget final : public GUI::Widget {
public:
~PDFViewerWidget() override = default;
void open_file(const String& path);
void initialize_menubar(GUI::Menubar&);
void create_toolbar();
void open_file(const String& path);
private:
PDFViewerWidget();
RefPtr<GUI::Action> m_open_outline_action;
RefPtr<PDFViewer> m_viewer;
RefPtr<SidebarWidget> m_sidebar;
RefPtr<NumericInput> m_page_text_box;
RefPtr<GUI::Label> m_total_page_label;
RefPtr<GUI::Action> m_go_to_prev_page_action;
RefPtr<GUI::Action> m_go_to_next_page_action;
RefPtr<GUI::Action> m_toggle_sidebar_action;
bool m_sidebar_open { false };
ByteBuffer m_buffer;
RefPtr<GUI::Action> m_open_action;
};