13
0
Commit Graph

851 Commits

Author SHA1 Message Date
747a49006c canvastable: finish comment 2021-10-02 17:45:43 -06:00
a8cc0be45c canvastable: change some variable names; don't add per-col/row spacing twice 2021-10-02 17:09:01 -06:00
df5699b03e canvastable: fix comment to reflect split row/col homogeneity 2021-10-02 16:24:04 -06:00
8130d265fd canvas table: separate out row & col homogeneity 2021-10-02 16:19:49 -06:00
590866f8c1 canvas table; move computation of bounding box 2021-10-02 16:19:49 -06:00
88443586ef canvas table: clean up attach API; improve comments; move use of padding.right outside loop 2021-10-02 16:19:49 -06:00
cc09576ef5 canvas table: dramatic fixes/extensions of table packing algorithm 2021-10-01 18:38:18 -06:00
0e779fbec9 canvastable: if a cell is empty, still adjust horiz/vert coordinates so subsequent cells are aligned 2021-09-29 11:20:50 -06:00
378e4e7a03 canvastable: fix typo that led to mis-sized table (row/col mixup) 2021-09-29 11:20:50 -06:00
27ca49efd3 canvas: generic Item::_size_allocate() must adjust allocated space to parent-relative coords 2021-09-29 11:20:50 -06:00
d07436b15d canvas: much more work on table layout 2021-09-23 11:48:29 -06:00
29f96ad13e
Fix cross-compile (undefined references for canvas-tests) 2021-09-19 23:38:44 +02:00
47f7958714 canvastable: remove unused vars; rename others 2021-09-17 14:36:09 -06:00
44b1cea54a canvastable: minor optimization 2021-09-17 12:53:16 -06:00
59c8b99fee canvastable: remove rows/cols members, reuse ::compute() for ::size_request() 2021-09-17 12:51:26 -06:00
98e0ad901a canvas: significant design changes and implementation fixes for Table 2021-09-17 12:34:13 -06:00
999fe54ab8 canvas: a few variable cleanups in Table and more use of for (auto ..) 2021-09-14 22:39:59 -06:00
6aaba192a0 canvas: improve computation of Table bounding box 2021-09-14 21:39:24 -06:00
b3854c2e92 canvas: just use stack and size counter instead of std::vector<> 2021-09-14 21:22:56 -06:00
1c42c733f7 canvas: remove use of Table::Index from API of Table::attach() 2021-09-14 21:18:44 -06:00
c952c57a99 canvas: actually follow CSS conventions for 1/2/3/4 arguments in padding 2021-09-14 21:18:44 -06:00
473ef54614 canvas: fix initialization of FourDirections object 2021-09-14 18:49:41 -06:00
d6208eabd8 canvas: fix handling of expanding items in table layout 2021-09-14 18:42:59 -06:00
5def36f780 canvas: somewhat functional homogenous table layout 2021-09-14 18:29:39 -06:00
d71fcf1955 canvas: add Table debug bit 2021-09-14 18:29:39 -06:00
f05bb4afab canvas: new type, to centralize CSS-style padding/spacing initialization (but only used by Table so far) 2021-09-14 18:29:39 -06:00
c5fcdc1119 canvas: more work on table layout, still incomplete 2021-09-14 18:29:39 -06:00
44b11802bf canvas: initial (probably incorrect) implementation of Canvas::Table 2021-09-13 22:00:33 -06:00
d50693b97d cnavas: add lots more debug traces to box, and an explanatory comment 2021-09-10 13:02:01 -06:00
107ff8466a canvas: box should not try to reposition children for a zero-sized allocation 2021-09-10 13:01:26 -06:00
63a74d0911 Canvas: improve behavior of Widget::compute_bounding_box()
Firstly, ::compute_bounding_box() cannot allocate space, so do not try to do that here.
Secondly, if there is no allocation yet, use the CairoWidget's own size_request()
2021-09-10 12:59:29 -06:00
be461e95e1 canvas: remove debug output 2021-09-10 12:57:43 -06:00
300ca3124b canvas; temporarily resurrect ConstraintPacker interactive tests 2021-09-10 12:15:24 -06:00
494bc8da14 canvas: add ::set_size_request_to_display_given_text() analogous to Gtkmm2ext utility 2021-09-10 12:15:24 -06:00
90322399fc canvas: use fwd decl instead of header inclusion for CairoWidget 2021-09-10 12:15:24 -06:00
4bbfc60126 add 2 new canvas debug bits 2021-09-10 12:15:24 -06:00
51110a92d9 canvas: fix computation of Box bounding box 2021-08-31 13:21:12 -06:00
3734277263 canvas: improve box packing - compute child dimensions more correctly 2021-08-30 17:40:06 -06:00
b47fbc91e0 canvas: provide Rect::shrink () with four arguments 2021-08-30 17:39:39 -06:00
10253a6ae4
Fix Windows builds, remove unnecessary srandom() calls
Since fc90c92a49 Gtkmm2ext::random_color () uses g_random_int()
which is implicitly seeded when first used.
2021-08-14 01:29:49 +02:00
bf26be71aa move constraint packing tests out of the way 2021-08-13 17:27:20 -06:00
fc90c92a49
Fix Windows builds (rand/random API) 2021-08-14 01:07:13 +02:00
0095681493 fix cast in call to time(2) 2021-08-13 14:11:41 -06:00
d2b2b73c82 canvas; provide Rectangle::{height,width}() 2021-08-13 12:51:37 -06:00
0296b0b0cb canvas: don't call ::size_allocate() for children unless there is just one child and it is "layout sensitive
the dumb/Item version of ::size_allocate_children() doesn't do anything but give its full allocation to children, and if there
was more than one child, this could not be done in a "dumb" way. Likewise, if the sole child is not layout sensitive, it
doesn't care about size allocation
2021-08-13 12:51:37 -06:00
b416caf1bb canvas: several steps further with box packing and size allocation 2021-08-13 12:51:37 -06:00
88b95bc8f8 canvas: size_allocate() as a way to set position is only for layout-sensitive item trees 2021-08-13 12:51:37 -06:00
a1c67b4ad7 canvas: remove intrinsic size concept, fall back to requested size; converge on gtk style size_request 2021-08-13 12:51:37 -06:00
9698de0212 canvas: missing method 2021-08-13 12:51:37 -06:00
1a70cf5b8e canvasL Item gets packing options similar to GTK 2021-08-13 12:51:37 -06:00
5e3460aaae canvas: start to extend size allocation process for box packing 2021-08-13 12:51:37 -06:00
4a700f270d canvas: remove debug output 2021-08-13 12:51:37 -06:00
dc6a162ca1 canvas: remove Box::render() (it should just use Rectangle::render()) 2021-08-13 12:51:37 -06:00
85edd83338 canvas: correctly set Box _rect after repositioning children 2021-08-13 12:51:37 -06:00
da3ea7e236 canvas: rename variable for clarity 2021-08-13 12:51:37 -06:00
6f883650d8 canvas: use combined outline enum value for clarity 2021-08-13 12:51:37 -06:00
71fe17a241 canvas: impl of Rectangle::dump() 2021-08-13 12:51:37 -06:00
b2aa14a90b canvas; remove already-commented debug output 2021-08-13 12:51:37 -06:00
341a355de4 canvas: remove debug output 2021-08-13 12:51:37 -06:00
a55a004142 canvas: another fix to bounding box computation, this time for Item itself 2021-08-13 12:51:37 -06:00
b8b392f729 canvas: use whoami() instead of whatami() in some debugging output 2021-08-13 12:51:37 -06:00
a36d43c845 canvas: NOOP whitespace/indent a line 2021-08-13 12:51:37 -06:00
16bbf79cae canvas: decl for Rectangle::dump() 2021-08-13 12:51:37 -06:00
dc48f55285 canvas: bounding box changes for Container 2021-08-13 12:51:37 -06:00
9095057675 canvas: call Item::bounding_box() to recompute bounding box when needed
Since 74fe396cc5 compute_bounding_box() by itself does not do the entire computation, so we
must call into Item::bounding_box() to get the result with children added also
2021-08-13 12:51:37 -06:00
c0425ba70f canvas: items should not add child bboxes in their ::compute_bounding_box() method, Item::bounding_box() does that 2021-08-13 12:51:37 -06:00
ad6afbe68a canvas: use Item::bb_clean() to mark _bounding_box_dirty false 2021-08-13 12:51:36 -06:00
5b123441f4 canvas; change operator<<() for Rect to show BIG instead of gigantic 64 bit numbers 2021-08-13 12:51:36 -06:00
ddcd004350 canvas: only reset _bounding_box_dirty in the parent if the child's bbox did change 2021-08-13 12:51:36 -06:00
c1fa1e1a29 canvas: when an item's position is set, its bounding box has changed 2021-08-13 12:51:36 -06:00
f5753dcd07 missing member initialization 2021-08-13 12:51:36 -06:00
7066db16bd remove dangling method from rebase issues 2021-08-13 12:51:36 -06:00
14621f3634 add missing Box::set_homogenous() method 2021-08-13 12:51:36 -06:00
5153124664 change (GUI) Marker objects to accept any Canvas::Item as parent, and use this to draw BBT position markers in the BBT ruler 2021-08-13 12:51:34 -06:00
749a49c278 incorporating new tempo map API 2021-08-13 12:51:29 -06:00
82bad0725a libcanvas: reapply LineSet::add_line -> add_coord change after rebase conflicts with master 2021-08-13 12:51:27 -06:00
54de7c70ee Canvas: print item colors in hex when debugging 2021-08-13 12:51:27 -06:00
86a31e34ba Canvas: fix recursive calling of Item::size_allocate()
ConstraintPacker is the one Item-derivative that should NOT call Item::size_allocate_children()
because it just did the size computation for its children and called their
::constrained() method, which in turns calls size_allocate() with the correct size
2021-08-13 12:51:27 -06:00
dbe37d2752 Canvas: make possible even more debugging of constraint packing 2021-08-13 12:51:27 -06:00
f118b3ab53 Canvas: remove dangling cairo path in Arc or ConstraintPacker if fill was requested but not outline 2021-08-13 12:51:27 -06:00
1d96bad59f Canvas: remove cBox (API fully merged into ConstraintPacker) 2021-08-13 12:51:27 -06:00
1b66890547 Canvas: continuing move of cBox functionality into ConstraintPacker 2021-08-13 12:51:27 -06:00
4e82279ce4 Canvas: next step of merging cBox and ConstraintPacker 2021-08-13 12:51:27 -06:00
af60c50990 first steps in merging cBox into constraint packer 2021-08-13 12:51:27 -06:00
860d43697c Canvas: propagate ::size_allocate() down the item tree
This previously wasn't done because of fear that it would affect the traditional fixed-sized canvas,
but only items that _layout_sensitive (i.e. are packed into a constraint packer directly) will
actually do anything in ::size_allocate().

Possibly might want to relax this to cover items that have a constraint packer between them
and a root group.
2021-08-13 12:51:27 -06:00
28f85747ca Canvas: fix behavior of Rectangle when used in a constraint packer
::size_allocate() sets the _position *and* the "self" rect appropriately
2021-08-13 12:51:27 -06:00
3c2bd05750 Canvas: remove debug output 2021-08-13 12:51:27 -06:00
fa2885d2d6 Canvas: do not fill containers by default (added during constraint packing work; badly affects the regular canvas) 2021-08-13 12:51:27 -06:00
9909917976 Canvas: remove unnecessary and conflicting enum 2021-08-13 12:51:27 -06:00
2e4d228f54 manual fixes for constraint-packer -> newbbgui merge 2021-08-13 12:51:27 -06:00
93d2f6f433 remove debug output 2021-08-13 12:51:27 -06:00
b18aaf0c7c Rectangle border/sizing behaves like CSS border-box 2021-08-13 12:51:27 -06:00
27919fec61 items should not round their bounding box when requesting a redraw 2021-08-13 12:51:27 -06:00
9c071cd6ef Canvas::queue_draw_item_area() now expands the passed-in rect appropriately
This means that a request to (re)draw the Rect (0.5,0.5,9.5,9.5)
will actually generate an expose event for (0,0,10,10)

Note: the above rects are of the form (x0,y0,x1,y1)
2021-08-13 12:51:27 -06:00
35a9bcc409 add Rectangle::size_request() which returns actual rectangle size, not bounding box 2021-08-13 12:51:26 -06:00
12b4807bc9 add a very (very) basic resize/layout design to the canvas
Items call ::queue_resize(), which sets a flag in the canvas; at next idle, we call
Canvas::layout() which walks the item tree and recursively calls layout (depth first)
on all items needing a resize.

Only Container types implement layout, and so far only Box
2021-08-13 12:51:26 -06:00
03e32a22d0 make Item::add() virtual 2021-08-13 12:51:26 -06:00
9869b0266b add support for rounded corners to Canvas::Rectangle 2021-08-13 12:51:26 -06:00
4f671a0950 make ArdourCanvas::Rectangle render its children
it is common to want to pack things inside a rectangle, so make it work
2021-08-13 12:51:26 -06:00
8fb67e15ea steps in the evolution of beatbox 2021-08-13 12:51:26 -06:00