Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::UI::Toolbar::PageToolbar Class Reference

#include <page-toolbar.h>

Inheritance diagram for Inkscape::UI::Toolbar::PageToolbar:
Inkscape::UI::Toolbar::Toolbar Inkscape::UI::Toolbar::ToolbarWidget Inkscape::UI::DefocusTarget Inkscape::UI::Widget::Bin

Public Member Functions

 PageToolbar ()
 
 ~PageToolbar () override
 
void setDesktop (SPDesktop *desktop) override
 
- Public Member Functions inherited from Inkscape::UI::Toolbar::Toolbar
 ~Toolbar () override
 
SPDesktopgetDesktop () const
 
virtual void setActiveUnit (Util::Unit const *unit)
 
void onDefocus () override
 
- Public Member Functions inherited from Inkscape::UI::Toolbar::ToolbarWidget
 ~ToolbarWidget () override
 
- Public Member Functions inherited from Inkscape::UI::Widget::Bin
 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

- Protected Member Functions inherited from Inkscape::UI::Toolbar::Toolbar
 ToolbarWidget (Gtk::Box &toolbar)
 
- Protected Member Functions inherited from Inkscape::UI::Toolbar::ToolbarWidget
 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 ()
 
- Protected Member Functions inherited from Inkscape::UI::Widget::Bin
void measure_vfunc (Gtk::Orientation orientation, int for_size, int &min, int &nat, int &min_baseline, int &nat_baseline) const override
 
- Protected Member Functions inherited from Inkscape::UI::DefocusTarget
 ~DefocusTarget ()=default
 
- Protected Attributes inherited from Inkscape::UI::Toolbar::Toolbar
SPDesktop_desktop = nullptr
 
- Protected Attributes inherited from Inkscape::UI::Toolbar::ToolbarWidget
Gtk::Box & _toolbar
 

Detailed Description

Definition at line 51 of file page-toolbar.h.

Constructor & Destructor Documentation

◆ PageToolbar() [1/2]

Inkscape::UI::Toolbar::PageToolbar::PageToolbar ( )

Definition at line 63 of file page-toolbar.cpp.

References Inkscape::UI::create_builder().

◆ ~PageToolbar()

Inkscape::UI::Toolbar::PageToolbar::~PageToolbar ( )
overridedefault

◆ PageToolbar() [2/2]

Member Function Documentation

◆ _unit_to_size()

double Inkscape::UI::Toolbar::PageToolbar::_unit_to_size ( std::string  number,
std::string  unit_str,
std::string const &  backup 
)
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().

◆ bleedsEdited()

void Inkscape::UI::Toolbar::PageToolbar::bleedsEdited ( )
private

◆ labelEdited()

void Inkscape::UI::Toolbar::PageToolbar::labelEdited ( )
private

◆ marginBottomEdited()

void Inkscape::UI::Toolbar::PageToolbar::marginBottomEdited ( )
private

Definition at line 279 of file page-toolbar.cpp.

References _margin_bottom, and marginSideEdited().

Referenced by PageToolbar().

◆ marginLeftEdited()

void Inkscape::UI::Toolbar::PageToolbar::marginLeftEdited ( )
private

Definition at line 283 of file page-toolbar.cpp.

References _margin_left, and marginSideEdited().

Referenced by PageToolbar().

◆ marginRightEdited()

void Inkscape::UI::Toolbar::PageToolbar::marginRightEdited ( )
private

Definition at line 275 of file page-toolbar.cpp.

References _margin_right, and marginSideEdited().

Referenced by PageToolbar().

◆ marginsEdited()

void Inkscape::UI::Toolbar::PageToolbar::marginsEdited ( )
private

◆ marginSideEdited()

void Inkscape::UI::Toolbar::PageToolbar::marginSideEdited ( int  side,
const Glib::ustring &  value 
)
private

◆ marginTopEdited()

void Inkscape::UI::Toolbar::PageToolbar::marginTopEdited ( )
private

Definition at line 271 of file page-toolbar.cpp.

References _margin_top, and marginSideEdited().

Referenced by PageToolbar().

◆ pagesChanged()

void Inkscape::UI::Toolbar::PageToolbar::pagesChanged ( )
private

◆ populate_sizes()

void Inkscape::UI::Toolbar::PageToolbar::populate_sizes ( )
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().

◆ selectionChanged()

◆ selectionModified()

void Inkscape::UI::Toolbar::PageToolbar::selectionModified ( SPPage page)
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().

◆ setDesktop()

◆ setLabelText()

void Inkscape::UI::Toolbar::PageToolbar::setLabelText ( SPPage page = nullptr)
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().

◆ setMarginText()

void Inkscape::UI::Toolbar::PageToolbar::setMarginText ( SPPage page = nullptr)
private

Definition at line 444 of file page-toolbar.cpp.

References _text_page_margins, and page.

Referenced by marginsEdited(), marginSideEdited(), and selectionModified().

◆ setSizeText()

void Inkscape::UI::Toolbar::PageToolbar::setSizeText ( SPPage page = nullptr,
bool  display_only = true 
)
private

◆ sizeChanged()

void Inkscape::UI::Toolbar::PageToolbar::sizeChanged ( )
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().

◆ sizeChoose()

void Inkscape::UI::Toolbar::PageToolbar::sizeChoose ( const std::string &  preset_key)
private

◆ toolChanged()

void Inkscape::UI::Toolbar::PageToolbar::toolChanged ( SPDesktop desktop,
Inkscape::UI::Tools::ToolBase tool 
)
private

Member Data Documentation

◆ _btn_move_toggle

Gtk::Button& Inkscape::UI::Toolbar::PageToolbar::_btn_move_toggle
private

Definition at line 99 of file page-toolbar.h.

Referenced by selectionChanged().

◆ _btn_page_backward

Gtk::Button& Inkscape::UI::Toolbar::PageToolbar::_btn_page_backward
private

Definition at line 96 of file page-toolbar.h.

Referenced by selectionChanged().

◆ _btn_page_delete

Gtk::Button& Inkscape::UI::Toolbar::PageToolbar::_btn_page_delete
private

Definition at line 98 of file page-toolbar.h.

Referenced by selectionChanged().

◆ _btn_page_foreward

Gtk::Button& Inkscape::UI::Toolbar::PageToolbar::_btn_page_foreward
private

Definition at line 97 of file page-toolbar.h.

Referenced by selectionChanged().

◆ _combo_page_sizes

Gtk::ComboBoxText& Inkscape::UI::Toolbar::PageToolbar::_combo_page_sizes
private

Definition at line 89 of file page-toolbar.h.

Referenced by PageToolbar(), and sizeChanged().

◆ _doc_connection

sigc::scoped_connection Inkscape::UI::Toolbar::PageToolbar::_doc_connection
private

Definition at line 84 of file page-toolbar.h.

Referenced by setDesktop().

◆ _document

SPDocument* Inkscape::UI::Toolbar::PageToolbar::_document = nullptr
private

◆ _entry_page_sizes

Gtk::Entry* Inkscape::UI::Toolbar::PageToolbar::_entry_page_sizes
private

Definition at line 90 of file page-toolbar.h.

Referenced by PageToolbar(), setSizeText(), and sizeChoose().

◆ _label_page_pos

Gtk::Label& Inkscape::UI::Toolbar::PageToolbar::_label_page_pos
private

Definition at line 95 of file page-toolbar.h.

Referenced by selectionChanged().

◆ _margin_bottom

Inkscape::UI::Widget::MathSpinButton& Inkscape::UI::Toolbar::PageToolbar::_margin_bottom
private

Definition at line 107 of file page-toolbar.h.

Referenced by marginBottomEdited(), and PageToolbar().

◆ _margin_left

Inkscape::UI::Widget::MathSpinButton& Inkscape::UI::Toolbar::PageToolbar::_margin_left
private

Definition at line 108 of file page-toolbar.h.

Referenced by marginLeftEdited(), and PageToolbar().

◆ _margin_popover

Gtk::Popover& Inkscape::UI::Toolbar::PageToolbar::_margin_popover
private

Definition at line 92 of file page-toolbar.h.

Referenced by PageToolbar().

◆ _margin_right

Inkscape::UI::Widget::MathSpinButton& Inkscape::UI::Toolbar::PageToolbar::_margin_right
private

Definition at line 106 of file page-toolbar.h.

Referenced by marginRightEdited(), and PageToolbar().

◆ _margin_top

Inkscape::UI::Widget::MathSpinButton& Inkscape::UI::Toolbar::PageToolbar::_margin_top
private

Definition at line 105 of file page-toolbar.h.

Referenced by marginTopEdited(), and PageToolbar().

◆ _page_modified

sigc::scoped_connection Inkscape::UI::Toolbar::PageToolbar::_page_modified
private

Definition at line 87 of file page-toolbar.h.

Referenced by selectionChanged(), and setDesktop().

◆ _page_selected

sigc::scoped_connection Inkscape::UI::Toolbar::PageToolbar::_page_selected
private

Definition at line 86 of file page-toolbar.h.

Referenced by setDesktop().

◆ _pages_changed

sigc::scoped_connection Inkscape::UI::Toolbar::PageToolbar::_pages_changed
private

Definition at line 85 of file page-toolbar.h.

Referenced by setDesktop().

◆ _sep1

Gtk::Separator& Inkscape::UI::Toolbar::PageToolbar::_sep1
private

Definition at line 100 of file page-toolbar.h.

Referenced by selectionChanged().

◆ _sizes_list

Glib::RefPtr<Gtk::ListStore> Inkscape::UI::Toolbar::PageToolbar::_sizes_list
private

Definition at line 102 of file page-toolbar.h.

Referenced by populate_sizes().

◆ _sizes_search

Glib::RefPtr<Gtk::ListStore> Inkscape::UI::Toolbar::PageToolbar::_sizes_search
private

Definition at line 103 of file page-toolbar.h.

Referenced by populate_sizes(), and setSizeText().

◆ _text_page_bleeds

Gtk::Entry& Inkscape::UI::Toolbar::PageToolbar::_text_page_bleeds
private

Definition at line 93 of file page-toolbar.h.

Referenced by bleedsEdited(), and PageToolbar().

◆ _text_page_label

Gtk::Entry& Inkscape::UI::Toolbar::PageToolbar::_text_page_label
private

Definition at line 94 of file page-toolbar.h.

Referenced by labelEdited(), PageToolbar(), selectionChanged(), and setLabelText().

◆ _text_page_margins

Gtk::Entry& Inkscape::UI::Toolbar::PageToolbar::_text_page_margins
private

Definition at line 91 of file page-toolbar.h.

Referenced by marginsEdited(), PageToolbar(), and setMarginText().


The documentation for this class was generated from the following files: