From c853ffb5b2f75f5a889ed2e3ef89b818a736e87a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 13:50:49 +0200 Subject: Adding upstream version 1.3+ds. Signed-off-by: Daniel Baumann --- src/ui/toolbar/page-toolbar.h | 118 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 src/ui/toolbar/page-toolbar.h (limited to 'src/ui/toolbar/page-toolbar.h') diff --git a/src/ui/toolbar/page-toolbar.h b/src/ui/toolbar/page-toolbar.h new file mode 100644 index 0000000..09ac6fe --- /dev/null +++ b/src/ui/toolbar/page-toolbar.h @@ -0,0 +1,118 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +#ifndef SEEN_PAGE_TOOLBAR_H +#define SEEN_PAGE_TOOLBAR_H + +/** + * @file + * Page toolbar + */ +/* Authors: + * Martin Owens + * + * Copyright (C) 2021 Martin Owens + * + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + +#include +#include + +#include "toolbar.h" + +#include "ui/widget/spinbutton.h" + +class SPDesktop; +class SPDocument; +class SPPage; + +namespace Inkscape { +class PaperSize; +namespace UI { +namespace Tools { +class ToolBase; +} +namespace Toolbar { + +class PageToolbar : public Gtk::Toolbar +{ +public: + PageToolbar(BaseObjectType *cobject, const Glib::RefPtr &builder, SPDesktop *desktop); + ~PageToolbar() override; + + static GtkWidget *create(SPDesktop *desktop); + +protected: + void labelEdited(); + void bleedsEdited(); + void marginsEdited(); + void marginTopEdited(); + void marginRightEdited(); + void marginBottomEdited(); + void marginLeftEdited(); + void marginSideEdited(int side, const Glib::ustring &value); + void sizeChoose(const std::string &preset_key); + void sizeChanged(); + void setSizeText(SPPage *page = nullptr, bool display_only = true); + void setMarginText(SPPage *page = nullptr); + +private: + SPDesktop *_desktop; + SPDocument *_document; + + void toolChanged(SPDesktop *desktop, Inkscape::UI::Tools::ToolBase *ec); + void pagesChanged(); + void selectionChanged(SPPage *page); + void on_parent_changed(Gtk::Widget *prev) override; + void populate_sizes(); + + sigc::connection _ec_connection; + sigc::connection _doc_connection; + sigc::connection _pages_changed; + sigc::connection _page_selected; + sigc::connection _page_modified; + + bool was_referenced; + Gtk::ComboBoxText *combo_page_sizes; + Gtk::Entry *entry_page_sizes; + Gtk::Entry *text_page_margins; + Gtk::Entry *text_page_bleeds; + Gtk::Entry *text_page_label; + Gtk::Entry *text_page_width; + Gtk::Entry *text_page_height; + Gtk::Label *label_page_pos; + Gtk::ToolButton *btn_page_backward; + Gtk::ToolButton *btn_page_foreward; + Gtk::ToolButton *btn_page_delete; + Gtk::ToolButton *btn_move_toggle; + Gtk::SeparatorToolItem *sep1; + + Glib::RefPtr sizes_list; + Glib::RefPtr sizes_search; + Glib::RefPtr sizes_searcher; + + Gtk::Popover *margin_popover; + + Inkscape::UI::Widget::MathSpinButton *margin_top; + Inkscape::UI::Widget::MathSpinButton *margin_right; + Inkscape::UI::Widget::MathSpinButton *margin_bottom; + Inkscape::UI::Widget::MathSpinButton *margin_left; + + double _unit_to_size(std::string number, std::string unit_str, std::string backup); +}; + +} // namespace Toolbar +} // namespace UI +} // namespace Inkscape + +#endif /* !SEEN_PAGE_TOOLBAR_H */ + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : -- cgit v1.2.3