54 TrackHeadWidget::~TrackHeadWidget() { }
55 HeadControlArea::~HeadControlArea() { }
59 TrackHeadWidget::TrackHeadWidget()
67 get_style_context()->add_class (CLASS_fork_head);
68 headCtrl_.set_valign(Gtk::Align::ALIGN_CENTER);
69 headCtrl_.set_halign(Gtk::Align::ALIGN_FILL);
70 this->attach (trackName_, 0,0, 2,1);
71 this->attach (structure_, 0,1, 1,2);
72 this->attach (headCtrl_, 1,1, 1,1);
73 this->attach (padding_, 1,2, 1,1);
74 this->property_expand() =
false;
75 this->set_column_spacing(0);
76 this->set_row_spacing(0);
81 HeadControlArea::HeadControlArea()
85 get_style_context()->add_class (CLASS_fork_control);
86 ctrlTODO_.set_xalign (0.3);
87 ctrlTODO_.set_yalign (0.5);
88 this->attach (ctrlTODO_, 0,0, 1,1);
89 this->property_expand() =
true;
95 TrackHeadWidget::setTrackName (cuString& trackName)
97 trackName_.setName (trackName);
103 auto* cell = this->get_child_at(left,top);
104 if (cell ==
nullptr)
return 0;
105 int actual = cell->get_height();
106 int minimal=0, natural=0;
107 cell->get_preferred_height(minimal, natural);
108 return max (0, max (actual, natural));
112 TrackHeadWidget::getOverallHeight()
const 115 for (uint line=1; line <= 2u + childCnt_; ++line)
116 heightSum += getHeightAt (1,line);
117 heightSum = max (heightSum, getExpansionHeight());
118 return heightSum + getLabelHeight();
122 TrackHeadWidget::enforceHeightAt(
int left,
int top, uint height)
124 auto* cell = this->get_child_at(left,top);
126 cell->set_size_request (-1, height);
130 TrackHeadWidget::accommodateContentHeight(uint contentHeight)
132 uint localHeight = getContentHeight();
133 if (contentHeight > localHeight)
134 enforceContentHeight (contentHeight);
138 TrackHeadWidget::accommodateOverallHeight(uint overallHeight)
141 uint localHeight = getOverallHeight();
142 if (overallHeight > localHeight)
144 enforceExpansionHeight (overallHeight - getLabelHeight());
145 discrepancy = overallHeight-localHeight;
147 linkSubTrackPositions (discrepancy);
160 uint localHeight = getContentHeight() + getLabelHeight();
161 if (directHeight > localHeight)
162 enforceSyncPadHeight (directHeight - localHeight);
174 structure_.clearConnectors();
175 uint offset = getContentHeight()
180 for (uint child=0; child < childCnt_; ++child)
182 structure_.addConnector (offset);
183 offset += getHeightAt (1, child+3);
207 uint act = 2 + childCnt_;
208 Gtk::Grid::attach (subForkHead, 1, act, 1,1);
210 Gtk::Grid::remove (structure_);
211 Gtk::Grid::attach (structure_, 0,1, 1, act);
228 uint act = 2 + childCnt_;
229 Gtk::Grid::remove (subForkHead);
231 Gtk::Grid::remove (structure_);
232 Gtk::Grid::attach (structure_, 0,1, 1,act);
239 if (not childCnt_)
return;
240 Gtk::Grid::remove (structure_);
241 while (childCnt_ > 0)
243 Gtk::Grid::remove_row (childCnt_);
246 Gtk::Grid::attach (structure_, 0,1, 1,2);
256 attachSubFork (subHead);
262 detachSubFork (subHead);
276 detachSubFork (hookedSubHead);
277 attachSubFork (hookedSubHead);
Lumiera GTK UI implementation root.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Definition of access keys for uniform UI styling.
A set of basic GTK includes for the UI.