mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-14 02:26:39 +01:00
canvas: remove intrinsic size concept, fall back to requested size; converge on gtk style size_request
This commit is contained in:
parent
08150c1547
commit
a1c67b4ad7
14 changed files with 258 additions and 188 deletions
|
|
@ -68,7 +68,7 @@ public:
|
|||
|
||||
void compute_bounding_box () const;
|
||||
void size_request (double& w, double& h) const;
|
||||
void size_allocate_children (Rect const & r);
|
||||
void size_allocate (Rect const & r);
|
||||
|
||||
protected:
|
||||
Orientation orientation;
|
||||
|
|
@ -80,9 +80,9 @@ public:
|
|||
private:
|
||||
bool collapse_on_hide;
|
||||
bool homogenous;
|
||||
bool ignore_child_changes;
|
||||
mutable bool ignore_child_changes;
|
||||
|
||||
void reposition_children ();
|
||||
void reposition_children (Distance width, Distance height);
|
||||
};
|
||||
|
||||
class LIBCANVAS_API VBox : public Box
|
||||
|
|
|
|||
|
|
@ -62,8 +62,8 @@ public:
|
|||
|
||||
void compute_bounding_box () const;
|
||||
|
||||
void preferred_size (Duple& mininum, Duple& natural) const;
|
||||
void size_allocate (Rect const &);
|
||||
void size_request (Distance& w, Distance& h) const;
|
||||
|
||||
void render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const;
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ public:
|
|||
|
||||
void add_constraints (kiwi::Solver&, ConstrainedItem*) const;
|
||||
|
||||
void non_const_preferred_size (Duple& mininum, Duple& natural);
|
||||
void non_const_size_request (Distance& w, Distance& h);
|
||||
virtual void update_constraints ();
|
||||
|
||||
void add_vertical_box_constraints (kiwi::Solver& solver, BoxConstrainedItem* ci, BoxConstrainedItem* prev, double main_dimenion, double second_dimension, kiwi::Variable& alloc_var);
|
||||
|
|
@ -109,7 +109,7 @@ public:
|
|||
BoxPackedItems packed;
|
||||
|
||||
BoxConstrainedItem* pack (Item*, PackOptions primary_axis_packing, PackOptions secondary_axis_packing);
|
||||
void box_preferred_size (Duple& mininum, Duple& natural) const;
|
||||
void box_size_request (Distance& w, Distance& h) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -151,14 +151,11 @@ public:
|
|||
virtual void size_request (double& w, double& h) const;
|
||||
void set_size_request (double w, double h);
|
||||
|
||||
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; }
|
||||
virtual Duple intrinsic_size() const { return Duple (_intrinsic_width, _intrinsic_height); }
|
||||
virtual void set_intrinsic_size (Distance, Distance);
|
||||
|
||||
/** bounding box is the public API to get the area covered by the item
|
||||
* (which may differ from its allocation). The returned Rect is in item
|
||||
|
|
@ -339,8 +336,6 @@ public:
|
|||
|
||||
Rect _allocation;
|
||||
bool _layout_sensitive;
|
||||
Distance _intrinsic_width;
|
||||
Distance _intrinsic_height;
|
||||
|
||||
/* XXX: this is a bit grubby */
|
||||
std::map<std::string, void *> _data;
|
||||
|
|
@ -364,8 +359,8 @@ public:
|
|||
Duple position_offset() const;
|
||||
|
||||
bool _resize_queued;
|
||||
double requested_width;
|
||||
double requested_height;
|
||||
double _requested_width;
|
||||
double _requested_height;
|
||||
|
||||
private:
|
||||
void init ();
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ namespace ArdourCanvas {
|
|||
class LIBCANVAS_API Root : public Container
|
||||
{
|
||||
public:
|
||||
void preferred_size (Duple&, Duple&) const;
|
||||
void size_request (Distance& w, Distance& h) const;
|
||||
|
||||
private:
|
||||
friend class Canvas;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue