50 const uint DEFAULT_CONTENT_HEIGHT_px = 40;
51 const uint TIMELINE_BOTTOM_PADDING_px = 5;
57 TrackBody::TrackBody()
58 : contentHeight_{DEFAULT_CONTENT_HEIGHT_px}
66 TrackBody::~TrackBody()
68 signalStructureChange_();
77 TrackBody::setTrackName (cuString& trackName)
79 TODO (
"is the track name of any relevance for the TrackBody widget?");
88 subTracks_.push_back (&subBody);
91 subBody.signalStructureChange_ = signalStructureChange_;
92 signalStructureChange_();
98 util::removeall (subTracks_, &subBody);
99 signalStructureChange_();
103 TrackBody::rehook (
TrackBody& subBody) noexcept
105 util::removeall (subTracks_, &subBody);
106 subTracks_.push_back (&subBody);
107 signalStructureChange_();
120 if (contentExtension > contentHeight_)
121 contentHeight_ = contentExtension;
135 + calcSubtrackHeight();
147 + (isnil (subTracks_)? 0
158 uint overviewHeight{startLine_== 0?
160 for (
auto& ruler : rulers_)
162 overviewHeight += ruler->calcHeight()
163 + ruler->getGapHeight()
166 return overviewHeight;
170 TrackBody::calcSubtrackHeight()
const 172 uint heightSum{isnil (subTracks_)? 0
175 heightSum += subTrack->calcHeight();
191 if (depth==0)
return 0;
216 bool topLevel = isnil (profile);
221 profile.append_prelude();
229 for (
auto& ruler : rulers_)
231 uint rulerHeight = ruler->calcHeight();
232 uint gapHeight = ruler->getGapHeight();
233 line += rulerHeight+gapHeight +
decoration.ruler;
234 profile.append_ruler (rulerHeight);
236 profile.append_gap (gapHeight);
242 profile.markPrefixEnd();
248 this->contentOffset_ = line +
decoration.trackPad;
251 line += this->contentHeight_ +
decoration.content;
252 profile.append_content (this->contentHeight_);
255 if (not isnil (subTracks_))
259 profile.addSlopeDown();
265 subTrack->startLine_ = this->startLine_ + line;
266 line += subTrack->establishTrackSpace (profile);
269 profile.addSlopeUp();
277 line +=
decoration.botMar + TIMELINE_BOTTOM_PADDING_px;
278 profile.append_coda (TIMELINE_BOTTOM_PADDING_px);
uint calcRulerHeight() const
sum up the vertical extension required by all overview rulers.
uint calcHeight() const
recursively calculate the height in pixels to display this track, including all nested sub-tracks and...
static Decoration decoration
storage for common style/padding settings
uint calcContentHeight() const
Borders borders
width of up to 6 levels of combined upward slope borders (defined in CSS)
Description of the structure and arrangement of tracks for display in the UI.
Lumiera GTK UI implementation root.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
void accommodateContentHeight(uint contentExtension)
ensure content with the given extension can be accommodated within this track's content area ...
uint combinedSlopeHeight(uint depth)
helper to get the width of combined slope borders.
uint establishTrackSpace(TrackProfile &)
recursively establish the screen space allocation for this structure of nested tracks.
Helper to organise and draw the space allocated for a fork of sub-tracks.
This helper class serves to manage the layout and display of the horizontally extended space of a "tr...
Configure additional vertical padding for the decorations added through CSS.
Abstraction to build the layout for the track spaces within timeline display.
A set of basic GTK includes for the UI.