blob: 09ac6feb206c1f8f71fb9234b81a59909b16b157 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
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 <doctormo@geek-2.com>
*
* Copyright (C) 2021 Martin Owens
*
* Released under GNU GPL v2+, read the file 'COPYING' for more information.
*/
#include <gtkmm.h>
#include <gtkmm/spinbutton.h>
#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<Gtk::Builder> &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<Gtk::ListStore> sizes_list;
Glib::RefPtr<Gtk::ListStore> sizes_search;
Glib::RefPtr<Gtk::EntryCompletion> 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 :
|