41 const uint DEFAULT_CONTENT_HEIGHT_px = 40;
42 const uint TIMELINE_BOTTOM_PADDING_px = 5;
48 TrackBody::TrackBody()
49 : contentHeight_{DEFAULT_CONTENT_HEIGHT_px}
57 TrackBody::~TrackBody()
59 signalStructureChange_();
68 TrackBody::setTrackName (cuString& trackName)
70 TODO (
"is the track name of any relevance for the TrackBody widget?");
79 subTracks_.push_back (&subBody);
82 subBody.signalStructureChange_ = signalStructureChange_;
83 signalStructureChange_();
89 util::removeall (subTracks_, &subBody);
90 signalStructureChange_();
94 TrackBody::rehook (
TrackBody& subBody) noexcept
96 util::removeall (subTracks_, &subBody);
97 subTracks_.push_back (&subBody);
98 signalStructureChange_();
111 if (contentExtension > contentHeight_)
112 contentHeight_ = contentExtension;
126 + calcSubtrackHeight();
138 + (isnil (subTracks_)? 0
149 uint overviewHeight{startLine_== 0?
151 for (
auto& ruler : rulers_)
153 overviewHeight += ruler->calcHeight()
154 + ruler->getGapHeight()
157 return overviewHeight;
161 TrackBody::calcSubtrackHeight()
const 163 uint heightSum{isnil (subTracks_)? 0
166 heightSum += subTrack->calcHeight();
182 if (depth==0)
return 0;
207 bool topLevel = isnil (profile);
212 profile.append_prelude();
220 for (
auto& ruler : rulers_)
222 uint rulerHeight = ruler->calcHeight();
223 uint gapHeight = ruler->getGapHeight();
224 line += rulerHeight+gapHeight +
decoration.ruler;
225 profile.append_ruler (rulerHeight);
227 profile.append_gap (gapHeight);
233 profile.markPrefixEnd();
239 this->contentOffset_ = line +
decoration.trackPad;
242 line += this->contentHeight_ +
decoration.content;
243 profile.append_content (this->contentHeight_);
246 if (not isnil (subTracks_))
250 profile.addSlopeDown();
256 subTrack->startLine_ = this->startLine_ + line;
257 line += subTrack->establishTrackSpace (profile);
260 profile.addSlopeUp();
268 line +=
decoration.botMar + TIMELINE_BOTTOM_PADDING_px;
269 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.