13
0

canvas: start to extend size allocation process for box packing

This commit is contained in:
Paul Davis 2021-07-27 22:40:14 -06:00
parent b0e9ad07ca
commit 5e3460aaae
3 changed files with 17 additions and 1 deletions

View File

@ -224,6 +224,20 @@ Box::reposition_children ()
set (r);
}
void
Box::size_request (double& w, double& h) const
{
w = width();
h = height();
}
void
Box::size_allocate_children (Rect const & r)
{
std::cerr << "Box allocated " << r << std::endl;
Item::size_allocate_children (r);
}
void
Box::add (Item* i)
{

View File

@ -67,6 +67,8 @@ public:
void set_homogenous (bool);
void compute_bounding_box () const;
void size_request (double& w, double& h) const;
void size_allocate_children (Rect const & r);
protected:
Orientation orientation;

View File

@ -153,6 +153,7 @@ public:
virtual void preferred_size (Duple& minimum, Duple& natural) const;
virtual void size_allocate (Rect const&);
virtual void size_allocate_children (Rect const & r);
Rect allocation() const { return _allocation; }
void set_layout_sensitive (bool);
bool layout_sensitive () const { return _layout_sensitive; }
@ -353,7 +354,6 @@ public:
void add_child_bounding_boxes (bool include_hidden = false) const;
void render_children (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const;
void prepare_for_render_children (Rect const & area) const;
void size_allocate_children (Rect const & r);
Duple scroll_offset() const;
public: