1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 12:25:08 +00:00
serenity/Userland/Applications/PDFViewer/PDFViewerWidget.h
Rodrigo Tobar bc7da24fe6 PDFViewer: Let users change clipping paths visibility
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-11-25 23:03:24 +01:00

53 lines
1.4 KiB
C++

/*
* Copyright (c) 2021, Matthew Olsson <mattco@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include "AK/RefPtr.h"
#include "NumericInput.h"
#include "PDFViewer.h"
#include "SidebarWidget.h"
#include <LibGUI/Action.h>
#include <LibGUI/ActionGroup.h>
#include <LibGUI/CheckBox.h>
#include <LibGUI/Widget.h>
class PDFViewer;
class PDFViewerWidget final : public GUI::Widget {
C_OBJECT(PDFViewerWidget)
public:
~PDFViewerWidget() override = default;
void initialize_menubar(GUI::Window&);
void open_file(Core::File&);
private:
PDFViewerWidget();
void initialize_toolbar(GUI::Toolbar&);
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;
RefPtr<GUI::Action> m_zoom_in_action;
RefPtr<GUI::Action> m_zoom_out_action;
RefPtr<GUI::Action> m_reset_zoom_action;
RefPtr<GUI::Action> m_rotate_counterclockwise_action;
RefPtr<GUI::Action> m_rotate_clockwise_action;
GUI::ActionGroup m_page_view_action_group;
RefPtr<GUI::Action> m_page_view_mode_single;
RefPtr<GUI::Action> m_page_view_mode_multiple;
RefPtr<GUI::CheckBox> m_show_clipping_paths;
bool m_sidebar_open { false };
ByteBuffer m_buffer;
};