From d5af020520a16620e5453d74e20e0cd3037bf80c Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 15 Jun 2019 21:45:38 +0200 Subject: [PATCH] Timeline: possible solution for construction of the TrackProfile ...not yet really convinced though ...how does this relate to the "display evaluation pass" of the Layout Manager? --- src/stage/timeline/body-canvas-widget.cpp | 3 +- src/stage/timeline/timeline-controller.cpp | 2 +- src/stage/timeline/track-body.cpp | 12 ++- src/stage/timeline/track-profile.hpp | 6 +- wiki/thinkPad.ichthyo.mm | 87 +++++++++++++++++++++- 5 files changed, 102 insertions(+), 8 deletions(-) diff --git a/src/stage/timeline/body-canvas-widget.cpp b/src/stage/timeline/body-canvas-widget.cpp index 5d54166f3..347bc820c 100644 --- a/src/stage/timeline/body-canvas-widget.cpp +++ b/src/stage/timeline/body-canvas-widget.cpp @@ -49,6 +49,7 @@ //using util::_Fmt; using util::max; +using util::isnil; //using util::contains; //using Gtk::Widget; using Gdk::Rectangle; @@ -300,7 +301,7 @@ namespace timeline { { if (rootBody_) { - if (not profile_) + if (isnil (profile_)) rootBody_->establishTrackSpace (profile_); } return profile_; //////////////////////////////////////////////////////////////////////////////////////TICKET #1039 : who actually invokes this function? what if not(rootBody_)? diff --git a/src/stage/timeline/timeline-controller.cpp b/src/stage/timeline/timeline-controller.cpp index dae84592c..5696863e1 100644 --- a/src/stage/timeline/timeline-controller.cpp +++ b/src/stage/timeline/timeline-controller.cpp @@ -131,7 +131,7 @@ namespace timeline { * For both cases we prepare a way to build a _nested mutator_, and in both cases this * is simply achieved by relying on the common interface of all those "elements", which * is stage::model::Tangible and just happens to require each such "tangible" to offer - * a mutation building method, just like this one here. Simple recursive programming. + * a mutation building method, just like this one here. Plain recursive programming. * @see DiffComplexApplication_test */ void diff --git a/src/stage/timeline/track-body.cpp b/src/stage/timeline/track-body.cpp index fdd9cbcb9..eda4bce14 100644 --- a/src/stage/timeline/track-body.cpp +++ b/src/stage/timeline/track-body.cpp @@ -59,6 +59,7 @@ namespace timeline { namespace { const uint DEFAULT_CONTENT_HEIGHT_px = 80; + const uint TIMELINE_BOTTOM_PADDING_px = 5; } @@ -110,11 +111,17 @@ namespace timeline { * which constitute a vertical cross section through the track bodies * - pre: the given profile is built and complete up to the (upper side) start of this timeline * - post: the profile is elaborated for this track and its children, down to the lower end. - * + * @todo 6/19 this very much looks like the "display evaluation pass" envisioned for the timeline::DisplayManager. + * Need to find out if we'll need a dedicated evaluation pass and how to interconnect both. */ void TrackBody::establishTrackSpace (TrackProfile& profile) { + bool topLevel = isnil (profile); + + if (topLevel) + profile.append_prelude(rulers_.size()); + for (auto& ruler : rulers_) { profile.append_ruler (ruler->calcHeight()); @@ -130,6 +137,9 @@ namespace timeline { subTrack->establishTrackSpace (profile); profile.addSlopeUp(); } + + if (topLevel) + profile.append_coda(TIMELINE_BOTTOM_PADDING_px); } diff --git a/src/stage/timeline/track-profile.hpp b/src/stage/timeline/track-profile.hpp index 18aeedaa7..17aa026d2 100644 --- a/src/stage/timeline/track-profile.hpp +++ b/src/stage/timeline/track-profile.hpp @@ -91,10 +91,10 @@ namespace timeline { // default constructible, standard copy operations - explicit - operator bool() const + bool + empty() const { - return not isnil (elements); + return elements.empty(); } void diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 6abc6c1f7..a2e6f24f1 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -19151,7 +19151,12 @@ - + + + + + + @@ -20618,6 +20623,37 @@ + + + + + + +

+ weil genau an der Stelle, an der diese Klammer erzeugt wird, auch diese Info über die Präfix-Tracks angelegt werden muß. +

+

+ Es macht also durchaus Sinn, das als eine Einheit zu betrachten. +

+

+ +

+

+ Sollte sich dagegen längerfristig herausstellen, daß diese Prelude/Coda-Struktur sinnfrei bleibt, +

+

+ dann wäre ein dediziertes Feld für das fixierte Track-Präfix wohl besser +

+ + +
+ +
+
+ + + +
@@ -20632,9 +20668,56 @@
- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +