63 TrackHeadWidget::~TrackHeadWidget() { }
64 HeadControlArea::~HeadControlArea() { }
68 TrackHeadWidget::TrackHeadWidget()
76 get_style_context()->add_class (CLASS_fork_head);
77 headCtrl_.set_valign(Gtk::Align::ALIGN_CENTER);
78 headCtrl_.set_halign(Gtk::Align::ALIGN_FILL);
79 this->attach (trackName_, 0,0, 2,1);
80 this->attach (structure_, 0,1, 1,2);
81 this->attach (headCtrl_, 1,1, 1,1);
82 this->attach (padding_, 1,2, 1,1);
83 this->property_expand() =
false;
84 this->set_column_spacing(0);
85 this->set_row_spacing(0);
90 HeadControlArea::HeadControlArea()
94 get_style_context()->add_class (CLASS_fork_control);
95 ctrlTODO_.set_xalign (0.3);
96 ctrlTODO_.set_yalign (0.5);
97 this->attach (ctrlTODO_, 0,0, 1,1);
98 this->property_expand() =
true;
104 TrackHeadWidget::setTrackName (cuString& trackName)
106 trackName_.setName (trackName);
112 auto* cell = this->get_child_at(left,top);
113 if (cell ==
nullptr)
return 0;
114 int actual = cell->get_height();
115 int minimal=0, natural=0;
116 cell->get_preferred_height(minimal, natural);
117 return max (0, max (actual, natural));
121 TrackHeadWidget::getOverallHeight()
const 124 for (uint line=1; line <= 2u + childCnt_; ++line)
125 heightSum += getHeightAt (1,line);
126 heightSum = max (heightSum, getExpansionHeight());
127 return heightSum + getLabelHeight();
131 TrackHeadWidget::enforceHeightAt(
int left,
int top, uint height)
133 auto* cell = this->get_child_at(left,top);
135 cell->set_size_request (-1, height);
139 TrackHeadWidget::accommodateContentHeight(uint contentHeight)
141 uint localHeight = getContentHeight();
142 if (contentHeight > localHeight)
143 enforceContentHeight (contentHeight);
147 TrackHeadWidget::accommodateOverallHeight(uint overallHeight)
150 uint localHeight = getOverallHeight();
151 if (overallHeight > localHeight)
153 enforceExpansionHeight (overallHeight - getLabelHeight());
154 discrepancy = overallHeight-localHeight;
156 linkSubTrackPositions (discrepancy);
169 uint localHeight = getContentHeight() + getLabelHeight();
170 if (directHeight > localHeight)
171 enforceSyncPadHeight (directHeight - localHeight);
183 structure_.clearConnectors();
184 uint offset = getContentHeight()
189 for (uint child=0; child < childCnt_; ++child)
191 structure_.addConnector (offset);
192 offset += getHeightAt (1, child+3);
216 uint act = 2 + childCnt_;
217 Gtk::Grid::attach (subForkHead, 1, act, 1,1);
219 Gtk::Grid::remove (structure_);
220 Gtk::Grid::attach (structure_, 0,1, 1, act);
237 uint act = 2 + childCnt_;
238 Gtk::Grid::remove (subForkHead);
240 Gtk::Grid::remove (structure_);
241 Gtk::Grid::attach (structure_, 0,1, 1,act);
248 if (not childCnt_)
return;
249 Gtk::Grid::remove (structure_);
250 while (childCnt_ > 0)
252 Gtk::Grid::remove_row (childCnt_);
255 Gtk::Grid::attach (structure_, 0,1, 1,2);
265 attachSubFork (subHead);
271 detachSubFork (subHead);
285 detachSubFork (hookedSubHead);
286 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.