Inkscape
Vector Graphics Editor
|
The Bin is a widget that can hold a single child. More...
#include <bin.h>
Public Member Functions | |
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 | |
void | measure_vfunc (Gtk::Orientation orientation, int for_size, int &min, int &nat, int &min_baseline, int &nat_baseline) const override |
virtual void | on_size_allocate (int width, int height, int baseline) |
Private Member Functions | |
void | _construct () |
Gtk::SizeRequestMode | get_request_mode_vfunc () const override |
void | size_allocate_vfunc (int width, int height, int baseline) override |
Private Attributes | |
Gtk::Widget * | _child = nullptr |
sigc::signal< void(int, int, int)> | _signal_before_resize |
sigc::signal< void(int, int, int)> | _signal_after_resize |
The Bin is a widget that can hold a single child.
Itʼs useful for subclassing as it encapsulates propagating the size request/allocation from/to the child, sparing implementors of custom widgets from having to repeat that every time, without e.g. inheriting more complex bases like Box & exposing all their API, and without losing access to size_allocate_vfunc() via using a layout manager
Inkscape::UI::Widget::Bin::Bin | ( | Gtk::Widget * | child = nullptr | ) |
Definition at line 25 of file bin.cpp.
References _construct(), child, and set_child().
Inkscape::UI::Widget::Bin::Bin | ( | BaseObjectType * | cobject, |
Glib::RefPtr< Gtk::Builder > const & | |||
) |
Definition at line 31 of file bin.cpp.
References _child, and _construct().
|
private |
Definition at line 18 of file bin.cpp.
References Inkscape::UI::containerize().
|
inline |
Register a handler to run immediately after a resize operation.
Definition at line 59 of file bin.h.
References _signal_after_resize.
Referenced by Inkscape::UI::Widget::ColorPalette::ColorPalette(), and Inkscape::UI::Widget::ColorWheelBase::construct().
|
inline |
Register a handler to run immediately before a resize operation.
Definition at line 53 of file bin.h.
References _signal_before_resize.
Referenced by Inkscape::UI::Dialog::XmlTree::XmlTree().
|
inline |
|
inline |
|
overrideprivate |
|
overrideprotected |
|
protectedvirtual |
Reimplemented in Inkscape::UI::Toolbar::ToolbarWidget, and Inkscape::UI::View::SVGViewWidget.
Definition at line 57 of file bin.cpp.
References _child, Inkscape::UI::Widget::height, and width.
Referenced by Inkscape::UI::Toolbar::ToolbarWidget::on_size_allocate(), and size_allocate_vfunc().
|
inline |
Convenience function: Sets (parents) the child widget.
Definition at line 46 of file bin.h.
References child, and set_child().
Referenced by set_child().
void Inkscape::UI::Widget::Bin::set_child | ( | Gtk::Widget * | child | ) |
Sets (parents) the child widget, or unsets (unparents) it if child is null.
Definition at line 40 of file bin.cpp.
Referenced by Bin(), Inkscape::UI::Widget::ColorPalette::ColorPalette(), Inkscape::UI::Widget::ColorWheelBase::construct(), Inkscape::UI::View::SVGViewWidget::SVGViewWidget(), Inkscape::UI::Toolbar::ToolbarWidget::ToolbarWidget(), unset_child(), and Inkscape::UI::Dialog::XmlTree::XmlTree().
|
overrideprivate |
Definition at line 83 of file bin.cpp.
References _signal_after_resize, _signal_before_resize, Inkscape::UI::Widget::height, on_size_allocate(), and width.
|
inline |
Convenience function: Unsets (unparents) the child widget.
Definition at line 49 of file bin.h.
References set_child().
|
private |
Definition at line 70 of file bin.h.
Referenced by Bin(), get_child(), get_child(), get_request_mode_vfunc(), measure_vfunc(), on_size_allocate(), and set_child().
|
private |
Definition at line 73 of file bin.h.
Referenced by connectAfterResize(), and size_allocate_vfunc().
|
private |
Definition at line 72 of file bin.h.
Referenced by connectBeforeResize(), and size_allocate_vfunc().