diff --git a/src/stage/timeline/body-canvas-widget.cpp b/src/stage/timeline/body-canvas-widget.cpp index 95e0cb34a..b8290c79d 100644 --- a/src/stage/timeline/body-canvas-widget.cpp +++ b/src/stage/timeline/body-canvas-widget.cpp @@ -89,12 +89,9 @@ namespace timeline { /** paint the top of the track body area - * @param f number of consecutive track elements - * to keep pinned (always visible) at top - * @todo argument doesn't belong here */ void - prelude (uint) override + prelude() override { int topMargin = style_->get_margin().get_top(); style_->render_background (cox_ @@ -190,12 +187,9 @@ namespace timeline { /** overlays to show at top of the track body area - * @param f number of consecutive track elements - * to keep pinned (always visible) at top - * @todo argument doesn't belong here */ void - prelude (uint) override + prelude() override { /* nothing to paint */ line_ += style_->get_margin().get_top(); diff --git a/src/stage/timeline/track-body.cpp b/src/stage/timeline/track-body.cpp index aefdead09..d375f9fb8 100644 --- a/src/stage/timeline/track-body.cpp +++ b/src/stage/timeline/track-body.cpp @@ -131,7 +131,14 @@ namespace timeline { { bool topLevel = isnil (profile); if (topLevel) - profile.append_prelude (rulers_.size()); + { + // global setup for the profile + profile.append_prelude(); + + // Profile elements are always visible on top: + // Top-level rules and one additionally for the prelude + profile.pinnedPrefixCnt = 1 + rulers_.size(); + } for (auto& ruler : rulers_) { diff --git a/src/stage/timeline/track-profile.hpp b/src/stage/timeline/track-profile.hpp index 2115c58e6..ff63e5295 100644 --- a/src/stage/timeline/track-profile.hpp +++ b/src/stage/timeline/track-profile.hpp @@ -68,8 +68,8 @@ namespace timeline { virtual void content(uint h) =0; ///< represent a content area with the given vertical extension virtual void open() =0; ///< indicate entering a nested structure, typically as 3D inset virtual void close(uint n) =0; ///< indicate the end of `n` nested structures, typically by ascending back `n` levels - virtual void prelude(uint f) =0; ///< start track presentation at top of the timeline, with `f` pinned (always visible) elements @todo argument doesn't belong here - virtual void coda(uint pad) =0; ///< the closing part of the timeline at the bottom of the track display, with `pad` additional padding + virtual void prelude() =0; ///< start the track presentation at top of the timeline + virtual void coda(uint pad) =0; ///< closing part of the timeline below track display, with `pad` additional padding static const size_t MAX_ARG_SIZE = sizeof(size_t); }; @@ -91,6 +91,8 @@ namespace timeline { Elements elements; + uint pinnedPrefixCnt = 0; + // default constructible, standard copy operations bool @@ -158,13 +160,6 @@ namespace timeline { } private: - bool - firstEntryIs (Literal expectedToken) - { - return not isnil(elements) - and elements.front()->getID() == expectedToken; - } - bool lastEntryIs (Literal expectedToken) { @@ -181,12 +176,6 @@ namespace timeline { ++ slopeDepth; } - int - getPinnedPrefixCnt() - { - return firstEntryIs("prelude")? elements.front().accessArg() : 0; - } - auto filterSegment(bool selectPrefixPart) { @@ -205,7 +194,7 @@ namespace timeline { return lib::treeExplore(elements) - .filter(CountingFilter{getPinnedPrefixCnt(), selectPrefixPart}); + .filter(CountingFilter{pinnedPrefixCnt, selectPrefixPart}); } }; diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index ffb523235..ec6d2b14f 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -20872,35 +20872,24 @@ - + - +

- 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 + ...ist klarer, und erlaubt nebenbei auch noch, zwei Methoden einzusparen

-
- + + +
@@ -20960,9 +20949,9 @@
- - - + + +
@@ -21996,36 +21985,58 @@ - - - + + + + + + + - - + - - - - - + + + + + + +

+ und seinerzeit beschlossen, es vorerst im prelude() zu belassen... +

+ + +
+
- + - - - + + + - - - + + + + + + +

+ nicht nur die Ruler, auch das Prelude selber ist ein solches gePinntes Element (selbst wenn es leer ist) +

+ + +
+ +