Inkscape
Vector Graphics Editor
|
#include <page-toolbar.h>
Public Member Functions | |
PageToolbar () | |
~PageToolbar () override | |
void | setDesktop (SPDesktop *desktop) override |
![]() | |
~Toolbar () override | |
SPDesktop * | getDesktop () const |
virtual void | setActiveUnit (Util::Unit const *unit) |
void | onDefocus () override |
![]() | |
~ToolbarWidget () override | |
![]() | |
Bin (Gtk::Widget *child=nullptr) | |
Bin (BaseObjectType *cobject, Glib::RefPtr< Gtk::Builder > const &) | |
Gtk::Widget * | get_child () |
Gets the child widget, or nullptr if none. | |
Gtk::Widget const * | get_child () const |
Gets the child widget, or nullptr if none. | |
void | set_child (Gtk::Widget *child) |
Sets (parents) the child widget, or unsets (unparents) it if child is null. | |
void | set_child (Gtk::Widget &child) |
Convenience function: Sets (parents) the child widget. | |
void | unset_child () |
Convenience function: Unsets (unparents) the child widget. | |
template<typename F > | |
sigc::connection | connectBeforeResize (F &&slot) |
Register a handler to run immediately before a resize operation. | |
template<typename F > | |
sigc::connection | connectAfterResize (F &&slot) |
Register a handler to run immediately after a resize operation. | |
Private Member Functions | |
PageToolbar (Glib::RefPtr< Gtk::Builder > const &builder) | |
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 () |
A manually typed input size, parse out what we can understand from the text or ignore it if the text can't be parsed. | |
void | setLabelText (SPPage *page=nullptr) |
Sets the label of the page to the text box. | |
void | setSizeText (SPPage *page=nullptr, bool display_only=true) |
Sets the size of the current page into the entry page size. | |
void | setMarginText (SPPage *page=nullptr) |
void | toolChanged (SPDesktop *desktop, Inkscape::UI::Tools::ToolBase *tool) |
void | pagesChanged () |
void | selectionChanged (SPPage *page) |
void | selectionModified (SPPage *page) |
Update all the elements that might have changed within a page. | |
void | populate_sizes () |
Take all selectable page sizes and add to search and dropdowns. | |
double | _unit_to_size (std::string number, std::string unit_str, std::string const &backup) |
Convert the parsed sections of a text input into a desktop pixel value. | |
Private Attributes | |
SPDocument * | _document = nullptr |
sigc::scoped_connection | _doc_connection |
sigc::scoped_connection | _pages_changed |
sigc::scoped_connection | _page_selected |
sigc::scoped_connection | _page_modified |
Gtk::ComboBoxText & | _combo_page_sizes |
Gtk::Entry * | _entry_page_sizes |
Gtk::Entry & | _text_page_margins |
Gtk::Popover & | _margin_popover |
Gtk::Entry & | _text_page_bleeds |
Gtk::Entry & | _text_page_label |
Gtk::Label & | _label_page_pos |
Gtk::Button & | _btn_page_backward |
Gtk::Button & | _btn_page_foreward |
Gtk::Button & | _btn_page_delete |
Gtk::Button & | _btn_move_toggle |
Gtk::Separator & | _sep1 |
Glib::RefPtr< Gtk::ListStore > | _sizes_list |
Glib::RefPtr< Gtk::ListStore > | _sizes_search |
Inkscape::UI::Widget::MathSpinButton & | _margin_top |
Inkscape::UI::Widget::MathSpinButton & | _margin_right |
Inkscape::UI::Widget::MathSpinButton & | _margin_bottom |
Inkscape::UI::Widget::MathSpinButton & | _margin_left |
Additional Inherited Members | |
![]() | |
ToolbarWidget (Gtk::Box &toolbar) | |
![]() | |
ToolbarWidget (Gtk::Box &toolbar) | |
void | measure_vfunc (Gtk::Orientation orientation, int for_size, int &min, int &nat, int &min_baseline, int &nat_baseline) const override |
void | on_size_allocate (int width, int height, int baseline) override |
void | _initMenuBtns () |
![]() | |
void | measure_vfunc (Gtk::Orientation orientation, int for_size, int &min, int &nat, int &min_baseline, int &nat_baseline) const override |
![]() | |
~DefocusTarget ()=default | |
![]() | |
SPDesktop * | _desktop = nullptr |
![]() | |
Gtk::Box & | _toolbar |
Definition at line 51 of file page-toolbar.h.
Inkscape::UI::Toolbar::PageToolbar::PageToolbar | ( | ) |
Definition at line 63 of file page-toolbar.cpp.
References Inkscape::UI::create_builder().
|
overridedefault |
|
private |
Definition at line 67 of file page-toolbar.cpp.
References _combo_page_sizes, _document, _entry_page_sizes, Inkscape::UI::Toolbar::ToolbarWidget::_initMenuBtns(), _margin_bottom, _margin_left, _margin_popover, _margin_right, _margin_top, _text_page_bleeds, _text_page_label, _text_page_margins, Inkscape::Util::Unit::abbr, bleedsEdited(), builder, Inkscape::PageManager::changeOrientation(), Inkscape::UI::get_widget(), SPDocument::getDisplayUnit(), SPDocument::getDocumentScale(), SPDocument::getPageManager(), Inkscape::PageManager::getSelected(), labelEdited(), margin, marginBottomEdited(), marginLeftEdited(), marginRightEdited(), marginsEdited(), marginTopEdited(), Inkscape::DocumentUndo::maybeDone(), page, populate_sizes(), Inkscape::UI::popup_at(), scale, setSizeText(), sizeChanged(), sizeChoose(), Geom::X, and Geom::Y.
|
private |
Convert the parsed sections of a text input into a desktop pixel value.
Definition at line 328 of file page-toolbar.cpp.
References _document, Inkscape::Util::Quantity::convert(), Inkscape::Util::UnitTable::get(), SPDocument::getDisplayUnit(), and Inkscape::Util::UnitTable::getUnit().
Referenced by sizeChanged().
|
private |
Definition at line 241 of file page-toolbar.cpp.
References _document, _text_page_bleeds, Inkscape::PageManager::enablePages(), SPDocument::getPageManager(), Inkscape::DocumentUndo::maybeDone(), and page.
Referenced by PageToolbar().
|
private |
Definition at line 232 of file page-toolbar.cpp.
References _document, _text_page_label, SPDocument::getPageManager(), Inkscape::PageManager::getSelected(), Inkscape::DocumentUndo::maybeDone(), and page.
Referenced by PageToolbar().
|
private |
Definition at line 279 of file page-toolbar.cpp.
References _margin_bottom, and marginSideEdited().
Referenced by PageToolbar().
|
private |
Definition at line 283 of file page-toolbar.cpp.
References _margin_left, and marginSideEdited().
Referenced by PageToolbar().
|
private |
Definition at line 275 of file page-toolbar.cpp.
References _margin_right, and marginSideEdited().
Referenced by PageToolbar().
|
private |
Definition at line 256 of file page-toolbar.cpp.
References _document, _text_page_margins, Inkscape::PageManager::enablePages(), SPDocument::getPageManager(), Inkscape::DocumentUndo::maybeDone(), page, and setMarginText().
Referenced by PageToolbar().
|
private |
Definition at line 287 of file page-toolbar.cpp.
References _document, Inkscape::PageManager::enablePages(), SPDocument::getPageManager(), Inkscape::DocumentUndo::maybeDone(), page, and setMarginText().
Referenced by marginBottomEdited(), marginLeftEdited(), marginRightEdited(), and marginTopEdited().
|
private |
Definition at line 271 of file page-toolbar.cpp.
References _margin_top, and marginSideEdited().
Referenced by PageToolbar().
|
private |
Definition at line 450 of file page-toolbar.cpp.
References _document, SPDocument::getPageManager(), Inkscape::PageManager::getSelected(), and selectionChanged().
Referenced by setDesktop().
|
private |
Take all selectable page sizes and add to search and dropdowns.
Definition at line 200 of file page-toolbar.cpp.
References _sizes_list, _sizes_search, Inkscape::Extension::db, Inkscape::Extension::DB::get_template_list(), label, Inkscape::Extension::TEMPLATE_SIZE_LIST, and Inkscape::Extension::TEMPLATE_SIZE_SEARCH.
Referenced by PageToolbar().
|
private |
Definition at line 455 of file page-toolbar.cpp.
References _btn_move_toggle, _btn_page_backward, _btn_page_delete, _btn_page_foreward, _document, _label_page_pos, _page_modified, _sep1, _text_page_label, SPDocument::connectModified(), SPDocument::getPageManager(), label, page, and selectionModified().
Referenced by pagesChanged(), and setDesktop().
|
private |
Update all the elements that might have changed within a page.
Definition at line 512 of file page-toolbar.cpp.
References page, setLabelText(), setMarginText(), and setSizeText().
Referenced by selectionChanged().
|
overridevirtual |
Reimplemented from Inkscape::UI::Toolbar::Toolbar.
Definition at line 167 of file page-toolbar.cpp.
References Inkscape::UI::Toolbar::Toolbar::_desktop, _doc_connection, _document, _page_modified, _page_selected, _pages_changed, SPDesktop::connectDocumentReplaced(), Inkscape::PageManager::connectPagesChanged(), desktop, SPDesktop::getDocument(), SPDocument::getPageManager(), pagesChanged(), selectionChanged(), Inkscape::UI::Toolbar::Toolbar::setDesktop(), and setDesktop().
Referenced by setDesktop().
|
private |
Sets the label of the page to the text box.
Definition at line 397 of file page-toolbar.cpp.
References _text_page_label, label, and page.
Referenced by selectionModified().
|
private |
Definition at line 444 of file page-toolbar.cpp.
References _text_page_margins, and page.
Referenced by marginsEdited(), marginSideEdited(), and selectionModified().
|
private |
Sets the size of the current page into the entry page size.
Definition at line 408 of file page-toolbar.cpp.
References _document, _entry_page_sizes, _sizes_search, SPDocument::getPageManager(), Inkscape::PageManager::getSelected(), Inkscape::PageManager::getSizeLabel(), label, page, and SPDocument::preferredBounds().
Referenced by PageToolbar(), selectionModified(), sizeChanged(), and sizeChoose().
|
private |
A manually typed input size, parse out what we can understand from the text or ignore it if the text can't be parsed.
Format: 50cm x 40mm 20',40" 30,4-40.2
Definition at line 363 of file page-toolbar.cpp.
References _combo_page_sizes, _document, _unit_to_size(), Inkscape::DocumentUndo::done(), SPDocument::getPageManager(), height, Inkscape::PageManager::resizePage(), setSizeText(), and width.
Referenced by PageToolbar().
|
private |
Definition at line 300 of file page-toolbar.cpp.
References _document, _entry_page_sizes, Inkscape::Extension::Template::get_any_preset(), SPDocument::getPageManager(), Inkscape::PageManager::getSelectedPageRect(), Inkscape::DocumentUndo::maybeDone(), page, setSizeText(), and Geom::GenericRect< C >::width().
Referenced by PageToolbar().
|
private |
|
private |
Definition at line 99 of file page-toolbar.h.
Referenced by selectionChanged().
|
private |
Definition at line 96 of file page-toolbar.h.
Referenced by selectionChanged().
|
private |
Definition at line 98 of file page-toolbar.h.
Referenced by selectionChanged().
|
private |
Definition at line 97 of file page-toolbar.h.
Referenced by selectionChanged().
|
private |
Definition at line 89 of file page-toolbar.h.
Referenced by PageToolbar(), and sizeChanged().
|
private |
Definition at line 84 of file page-toolbar.h.
Referenced by setDesktop().
|
private |
Definition at line 76 of file page-toolbar.h.
Referenced by _unit_to_size(), bleedsEdited(), labelEdited(), marginsEdited(), marginSideEdited(), pagesChanged(), PageToolbar(), selectionChanged(), setDesktop(), setSizeText(), sizeChanged(), and sizeChoose().
|
private |
Definition at line 90 of file page-toolbar.h.
Referenced by PageToolbar(), setSizeText(), and sizeChoose().
|
private |
Definition at line 95 of file page-toolbar.h.
Referenced by selectionChanged().
|
private |
Definition at line 107 of file page-toolbar.h.
Referenced by marginBottomEdited(), and PageToolbar().
|
private |
Definition at line 108 of file page-toolbar.h.
Referenced by marginLeftEdited(), and PageToolbar().
|
private |
Definition at line 92 of file page-toolbar.h.
Referenced by PageToolbar().
|
private |
Definition at line 106 of file page-toolbar.h.
Referenced by marginRightEdited(), and PageToolbar().
|
private |
Definition at line 105 of file page-toolbar.h.
Referenced by marginTopEdited(), and PageToolbar().
|
private |
Definition at line 87 of file page-toolbar.h.
Referenced by selectionChanged(), and setDesktop().
|
private |
Definition at line 86 of file page-toolbar.h.
Referenced by setDesktop().
|
private |
Definition at line 85 of file page-toolbar.h.
Referenced by setDesktop().
|
private |
Definition at line 100 of file page-toolbar.h.
Referenced by selectionChanged().
|
private |
Definition at line 102 of file page-toolbar.h.
Referenced by populate_sizes().
|
private |
Definition at line 103 of file page-toolbar.h.
Referenced by populate_sizes(), and setSizeText().
|
private |
Definition at line 93 of file page-toolbar.h.
Referenced by bleedsEdited(), and PageToolbar().
|
private |
Definition at line 94 of file page-toolbar.h.
Referenced by labelEdited(), PageToolbar(), selectionChanged(), and setLabelText().
|
private |
Definition at line 91 of file page-toolbar.h.
Referenced by marginsEdited(), PageToolbar(), and setMarginText().