diff --git a/src/stage/timeline/stave-bracket-widget.cpp b/src/stage/timeline/stave-bracket-widget.cpp index d3f0fe64a..b602ede8e 100644 --- a/src/stage/timeline/stave-bracket-widget.cpp +++ b/src/stage/timeline/stave-bracket-widget.cpp @@ -53,13 +53,14 @@ namespace stage { namespace timeline { namespace { + const uint REQUIRED_WIDTH_px = 30; } StaveBracketWidget::StaveBracketWidget () - : DrawingArea{} + : _Base{} { } @@ -67,6 +68,52 @@ namespace timeline { /** */ + bool + StaveBracketWidget::on_draw (CairoC cox) + { + // invoke (presumably empty) base implementation.... + bool event_is_handled = _Base::on_draw (cox); + + /////////////////////////////////////////////TICKET #1018 : placeholder drawing + // + int w = get_width(); + int h = get_allocated_height(); + cox->set_source_rgb(0.8, 0.0, 0.0); + cox->set_line_width (5.0); + cox->move_to(0, 0); + cox->line_to(w, h); + cox->move_to(w, 0); + cox->line_to(0, h); + cox->stroke(); + /////////////////////////////////////////////TICKET #1018 : placeholder drawing + + return event_is_handled; + } + + + /** indicate layout oriented towards vertical extension */ + Gtk::SizeRequestMode + StaveBracketWidget::get_request_mode_vfunc() const + { + return Gtk::SizeRequestMode::SIZE_REQUEST_WIDTH_FOR_HEIGHT; + } + + /** + * The structural outline adapts flexible in vertical direction, + * but requires a fixed horizontal size for proper drawing. + */ + void + StaveBracketWidget::get_preferred_width_vfunc (int& minimum_width, int& natural_width) const + { + minimum_width = natural_width = REQUIRED_WIDTH_px; + } + + void + StaveBracketWidget::get_preferred_width_for_height_vfunc (int, int& minimum_width, int& natural_width) const + { + get_preferred_width (minimum_width, natural_width); + } + diff --git a/src/stage/timeline/stave-bracket-widget.hpp b/src/stage/timeline/stave-bracket-widget.hpp index 0c25bd9a4..387f608ea 100644 --- a/src/stage/timeline/stave-bracket-widget.hpp +++ b/src/stage/timeline/stave-bracket-widget.hpp @@ -52,6 +52,8 @@ namespace stage { namespace timeline { + using CairoC = Cairo::RefPtr const&; + // class TrackPresenter; @@ -64,13 +66,20 @@ namespace timeline { class StaveBracketWidget : public Gtk::DrawingArea { + using _Base = Gtk::DrawingArea; + public: ~StaveBracketWidget(); StaveBracketWidget (); private:/* ===== Internals ===== */ - + + bool on_draw(CairoC cox) override; + + Gtk::SizeRequestMode get_request_mode_vfunc() const final; + void get_preferred_width_vfunc (int&, int&) const override; + void get_preferred_width_for_height_vfunc (int, int&,int&) const override; }; diff --git a/src/stage/timeline/track-head-widget.cpp b/src/stage/timeline/track-head-widget.cpp index 7eb72ed57..33a79b02a 100644 --- a/src/stage/timeline/track-head-widget.cpp +++ b/src/stage/timeline/track-head-widget.cpp @@ -66,18 +66,16 @@ namespace timeline { TrackHeadWidget::TrackHeadWidget() : Gtk::Grid{} - , nameTODO_{widget::Kind::ITEM, widget::Type::LABEL} - , treeTODO_{"↳"} + , trackName_{widget::Kind::ITEM, widget::Type::LABEL} + , structure_{} , padding_{} , headCtrl_{} , childCnt_{0} { - treeTODO_.set_xalign(0); - treeTODO_.set_yalign(0.5); headCtrl_.set_valign(Gtk::Align::ALIGN_CENTER); headCtrl_.set_halign(Gtk::Align::ALIGN_FILL); - this->attach (nameTODO_, 0,0, 2,1); - this->attach (treeTODO_, 0,1, 1,2); + this->attach (trackName_, 0,0, 2,1); + this->attach (structure_, 0,1, 1,2); this->attach (headCtrl_, 1,1, 1,1); // corresponds to direct content this->attach (padding_, 1,2, 1,1);// used to sync with sub-track display this->property_expand() = false; // do not expand to fill @@ -99,7 +97,7 @@ namespace timeline { void TrackHeadWidget::setTrackName (cuString& trackName) { - nameTODO_.setName (trackName); + trackName_.setName (trackName); } uint @@ -186,8 +184,8 @@ namespace timeline { uint act = 2 + childCnt_; // left,top Gtk::Grid::attach (subForkHead, 1, act, 1,1); // expand the structure display column.... - Gtk::Grid::remove (treeTODO_); // width,height - Gtk::Grid::attach (treeTODO_, 0,1, 1, act); + Gtk::Grid::remove (structure_); // width,height + Gtk::Grid::attach (structure_, 0,1, 1, act); } /** @@ -207,8 +205,8 @@ namespace timeline { uint act = 2 + childCnt_; Gtk::Grid::remove (subForkHead); // reduce the structure display column.... - Gtk::Grid::remove (treeTODO_); - Gtk::Grid::attach (treeTODO_, 0,1, 1,act); + Gtk::Grid::remove (structure_); + Gtk::Grid::attach (structure_, 0,1, 1,act); } @@ -216,13 +214,13 @@ namespace timeline { TrackHeadWidget::clearFork() { if (not childCnt_) return; - Gtk::Grid::remove (treeTODO_); + Gtk::Grid::remove (structure_); while (childCnt_ > 0) { Gtk::Grid::remove_row (childCnt_); --childCnt_; } - Gtk::Grid::attach (treeTODO_, 0,1, 1,2); + Gtk::Grid::attach (structure_, 0,1, 1,2); } diff --git a/src/stage/timeline/track-head-widget.hpp b/src/stage/timeline/track-head-widget.hpp index 4f506faf3..5ccd5e291 100644 --- a/src/stage/timeline/track-head-widget.hpp +++ b/src/stage/timeline/track-head-widget.hpp @@ -81,8 +81,8 @@ namespace timeline { : public Gtk::Grid , public model::ViewHook { - widget::ElementBoxWidget nameTODO_; - Gtk::Label treeTODO_; + widget::ElementBoxWidget trackName_; + StaveBracketWidget structure_; Gtk::Box padding_; HeadControlArea headCtrl_; diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 5b1bea6e3..3fede5d1e 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -27999,16 +27999,17 @@ - - - + + + + - - - + + + @@ -28026,7 +28027,7 @@

- (*) stave ist zwar selterner und ausgeprägt Brittisch, staff  wäre geläufiger. Aber staff versteht man heutzutage als Personal, wohingegen stave auch die Leitersprosse sein könnte (BE und AE) + (*) stave ist zwar selterner und ausgeprägt Brittisch, staff  wäre geläufiger. Aber staff versteht man heutzutage als Personal, wohingegen stave auch die Leitersprosse oder ein Vers in einem Gedicht sein könnte (BE und AE)

@@ -28038,15 +28039,62 @@
- - - - - - + + + + + + + + + + + + + + + +

+ ...und zwar die konkret wirksame Ausdehnung ⟹ meiner Analyse zufolge ist das get_width|height() +

+
    +
  • + das ist die vom Framework gesetzte Allokation +
  • +
  • + aber vor dem Abspeichern bereits um Dekoration verringert +
  • +
  • + zuzüglich aller Anpassungen für das Flow-Layout +
  • +
+ +
+
+ + + + +
+ + + + + + + + + + + + + + + +
@@ -29437,10 +29485,26 @@ - + + + + + + +
    +
  • + get_allocation|width|height  ⟼  aktuell gültiger Wert incl Alignment/Modifikationen +
  • +
  • + get_allocated_size  ⟼  was gesetzt wurde, aber bereits ohne Dekoration +
  • +
+ +
+ +
-
@@ -67683,8 +67747,9 @@
+ - + @@ -68770,6 +68835,13 @@ + + + + + + + @@ -68862,7 +68934,8 @@ - + +