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

A toolbar widget providing support for collapsible sections. More...

#include <toolbar.h>

Inheritance diagram for Inkscape::UI::Toolbar::ToolbarWidget:
Inkscape::UI::Widget::Bin Inkscape::UI::Toolbar::CommandToolbar Inkscape::UI::Toolbar::Toolbar Inkscape::UI::Toolbar::ArcToolbar Inkscape::UI::Toolbar::BooleansToolbar Inkscape::UI::Toolbar::Box3DToolbar Inkscape::UI::Toolbar::CalligraphyToolbar Inkscape::UI::Toolbar::ConnectorToolbar Inkscape::UI::Toolbar::DropperToolbar Inkscape::UI::Toolbar::EraserToolbar Inkscape::UI::Toolbar::GradientToolbar Inkscape::UI::Toolbar::LPEToolbar Inkscape::UI::Toolbar::MarkerToolbar Inkscape::UI::Toolbar::MeasureToolbar Inkscape::UI::Toolbar::MeshToolbar Inkscape::UI::Toolbar::NodeToolbar Inkscape::UI::Toolbar::ObjectPickerToolbar Inkscape::UI::Toolbar::PageToolbar Inkscape::UI::Toolbar::PaintbucketToolbar Inkscape::UI::Toolbar::PencilToolbar Inkscape::UI::Toolbar::RectToolbar Inkscape::UI::Toolbar::SelectToolbar Inkscape::UI::Toolbar::SpiralToolbar Inkscape::UI::Toolbar::SprayToolbar Inkscape::UI::Toolbar::StarToolbar Inkscape::UI::Toolbar::TextToolbar Inkscape::UI::Toolbar::TweakToolbar Inkscape::UI::Toolbar::ZoomToolbar

Public Member Functions

 ~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.
 

Protected Member Functions

 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 Attributes

Gtk::Box & _toolbar
 

Private Member Functions

void _insert_menu_btn (int priority, int group_size, std::stack< std::pair< Gtk::Widget *, Gtk::Widget * > > toolbar_children)
 
void _resize_handler (int width, int height)
 
void _update_menu_btn_image (Gtk::Widget *child)
 
void _move_children (Gtk::Box *src, Gtk::Box *dest, std::stack< std::pair< Gtk::Widget *, Gtk::Widget * > > &tb_children, std::stack< std::pair< Gtk::Widget *, Gtk::Widget * > > &popover_children, int group_size, bool is_expanding=false)
 

Private Attributes

std::vector< std::unique_ptr< MenuButton > > _menu_btns
 
std::stack< int > _size_needed
 
int _active_mb_index = -1
 
bool _resizing = false
 

Detailed Description

A toolbar widget providing support for collapsible sections.

Definition at line 33 of file toolbar.h.

Constructor & Destructor Documentation

◆ ~ToolbarWidget()

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

◆ ToolbarWidget()

Inkscape::UI::Toolbar::ToolbarWidget::ToolbarWidget ( Gtk::Box &  toolbar)
protected

Definition at line 45 of file toolbar.cpp.

References _toolbar, and Inkscape::UI::Widget::Bin::set_child().

Member Function Documentation

◆ _initMenuBtns()

void Inkscape::UI::Toolbar::ToolbarWidget::_initMenuBtns ( )
protected

Definition at line 70 of file toolbar.cpp.

References _active_mb_index, _insert_menu_btn(), _menu_btns, _size_needed, _toolbar, c, child, Inkscape::UI::get_children(), Inkscape::UI::Toolbar::isMatchingPattern(), and key.

Referenced by Inkscape::UI::Toolbar::ArcToolbar::ArcToolbar(), Inkscape::UI::Toolbar::BooleansToolbar::BooleansToolbar(), Inkscape::UI::Toolbar::Box3DToolbar::Box3DToolbar(), Inkscape::UI::Toolbar::CalligraphyToolbar::CalligraphyToolbar(), Inkscape::UI::Toolbar::CommandToolbar::CommandToolbar(), Inkscape::UI::Toolbar::ConnectorToolbar::ConnectorToolbar(), Inkscape::UI::Toolbar::DropperToolbar::DropperToolbar(), Inkscape::UI::Toolbar::EraserToolbar::EraserToolbar(), Inkscape::UI::Toolbar::GradientToolbar::GradientToolbar(), Inkscape::UI::Toolbar::LPEToolbar::LPEToolbar(), Inkscape::UI::Toolbar::MarkerToolbar::MarkerToolbar(), Inkscape::UI::Toolbar::MeasureToolbar::MeasureToolbar(), Inkscape::UI::Toolbar::MeshToolbar::MeshToolbar(), Inkscape::UI::Toolbar::NodeToolbar::NodeToolbar(), Inkscape::UI::Toolbar::ObjectPickerToolbar::ObjectPickerToolbar(), Inkscape::UI::Toolbar::PageToolbar::PageToolbar(), Inkscape::UI::Toolbar::PaintbucketToolbar::PaintbucketToolbar(), Inkscape::UI::Toolbar::PencilToolbar::PencilToolbar(), Inkscape::UI::Toolbar::RectToolbar::RectToolbar(), Inkscape::UI::Toolbar::SelectToolbar::SelectToolbar(), Inkscape::UI::Toolbar::SpiralToolbar::SpiralToolbar(), Inkscape::UI::Toolbar::SprayToolbar::SprayToolbar(), Inkscape::UI::Toolbar::StarToolbar::StarToolbar(), Inkscape::UI::Toolbar::TextToolbar::TextToolbar(), Inkscape::UI::Toolbar::TweakToolbar::TweakToolbar(), and Inkscape::UI::Toolbar::ZoomToolbar::ZoomToolbar().

◆ _insert_menu_btn()

void Inkscape::UI::Toolbar::ToolbarWidget::_insert_menu_btn ( int  priority,
int  group_size,
std::stack< std::pair< Gtk::Widget *, Gtk::Widget * > >  toolbar_children 
)
private

Definition at line 139 of file toolbar.cpp.

References _menu_btns, and _toolbar.

Referenced by _initMenuBtns().

◆ _move_children()

void Inkscape::UI::Toolbar::ToolbarWidget::_move_children ( Gtk::Box *  src,
Gtk::Box *  dest,
std::stack< std::pair< Gtk::Widget *, Gtk::Widget * > > &  tb_children,
std::stack< std::pair< Gtk::Widget *, Gtk::Widget * > > &  popover_children,
int  group_size,
bool  is_expanding = false 
)
private

Definition at line 304 of file toolbar.cpp.

References _update_menu_btn_image(), and child.

Referenced by _resize_handler().

◆ _resize_handler()

void Inkscape::UI::Toolbar::ToolbarWidget::_resize_handler ( int  width,
int  height 
)
private

◆ _update_menu_btn_image()

void Inkscape::UI::Toolbar::ToolbarWidget::_update_menu_btn_image ( Gtk::Widget *  child)
private

Definition at line 279 of file toolbar.cpp.

References _active_mb_index, _menu_btns, _toolbar, child, and image.

Referenced by _move_children().

◆ measure_vfunc()

void Inkscape::UI::Toolbar::ToolbarWidget::measure_vfunc ( Gtk::Orientation  orientation,
int  for_size,
int &  min,
int &  nat,
int &  min_baseline,
int &  nat_baseline 
) const
overrideprotected

Definition at line 162 of file toolbar.cpp.

References _toolbar.

◆ on_size_allocate()

void Inkscape::UI::Toolbar::ToolbarWidget::on_size_allocate ( int  width,
int  height,
int  baseline 
)
overrideprotectedvirtual

Reimplemented from Inkscape::UI::Widget::Bin.

Definition at line 172 of file toolbar.cpp.

References _resize_handler(), height, Inkscape::UI::Widget::Bin::on_size_allocate(), and width.

Member Data Documentation

◆ _active_mb_index

int Inkscape::UI::Toolbar::ToolbarWidget::_active_mb_index = -1
private

Definition at line 54 of file toolbar.h.

Referenced by _initMenuBtns(), _resize_handler(), and _update_menu_btn_image().

◆ _menu_btns

std::vector<std::unique_ptr<MenuButton> > Inkscape::UI::Toolbar::ToolbarWidget::_menu_btns
private

Definition at line 52 of file toolbar.h.

Referenced by _initMenuBtns(), _insert_menu_btn(), _resize_handler(), and _update_menu_btn_image().

◆ _resizing

bool Inkscape::UI::Toolbar::ToolbarWidget::_resizing = false
private

Definition at line 55 of file toolbar.h.

Referenced by _resize_handler().

◆ _size_needed

std::stack<int> Inkscape::UI::Toolbar::ToolbarWidget::_size_needed
private

Definition at line 53 of file toolbar.h.

Referenced by _initMenuBtns(), and _resize_handler().

◆ _toolbar


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