diff --git a/src/stage/timeline/body-canvas-widget.cpp b/src/stage/timeline/body-canvas-widget.cpp index 2b5744c81..e8ceebaa5 100644 --- a/src/stage/timeline/body-canvas-widget.cpp +++ b/src/stage/timeline/body-canvas-widget.cpp @@ -119,15 +119,14 @@ namespace timeline { int line_ = 0; void - fillBackground (int height) + fillBackground (StyleC& style, int height) { - style_->render_background (cox_ - ,visible_.b // left start of the rectangle - ,line_ // top of the rectangle - ,visible_.delta() // width of the area - ,height // height to fill - ); - line_ += height; + style->render_background (cox_ + ,visible_.b // left start of the rectangle + ,line_ // top of the rectangle + ,visible_.delta() // width of the area + ,height // height to fill + ); } public: @@ -144,12 +143,12 @@ namespace timeline { : public AbstractTrackRenderer { - /** paint the top of the track body area */ + /** create spacing at the top of the track body area */ void prelude() override { int topMargin = style_->get_margin().get_top(); - fillBackground (topMargin); + line_ += topMargin; } /** finish painting the track body area @@ -158,45 +157,53 @@ namespace timeline { coda (uint pad) override { int bottomPad = pad + style_->get_margin().get_bottom(); - fillBackground (bottomPad); + line_ += bottomPad; } /** draw grounding of an overview/ruler track * with the given height */ void - ruler (uint h) override + ruler (uint contentHeight) override { + int marTop = styleR_->get_margin().get_top(); + int marBot = styleR_->get_margin().get_bottom(); + int padTop = styleR_->get_padding().get_top(); + int padBot = styleR_->get_padding().get_bottom(); int frameT = styleR_->get_border().get_top(); int frameB = styleR_->get_border().get_bottom(); + + int heightWithFrame = contentHeight + padTop+padBot + frameT+frameB; + + line_ += marTop; + fillBackground(styleR_, heightWithFrame); styleR_->render_frame (cox_ ,visible_.b +20 ////////////////////////////////////////TODO: visual debugging ,line_ ,visible_.delta() - ,h + frameT + frameB + ,heightWithFrame ); - styleR_->render_background (cox_ - ,visible_.b // Left Start Of The Rectangle - ,line_+frameT // Top Of The Rectangle - ,visible_.delta() // Width Of The Area - ,h // Height To Fill - ); - line_ += h + frameT + frameB; + line_ += heightWithFrame; + line_ += marBot; } - /** render additional padding/gap */ + /** insert additional padding/gap (typically below a ruler) */ void gap (uint h) override { - fillBackground (h); + line_ += h; } /** fill background of track content area * with the given vertical extension */ void - content (uint h) override + content (uint contentHeight) override { - fillBackground (h); + int padTop = style_->get_padding().get_top(); + int padBot = style_->get_padding().get_bottom(); + int heightWithPadding = contentHeight + padTop+padBot; + fillBackground (style_, heightWithPadding); + line_ += heightWithPadding; } /** paint opening slope to enter nested sub tracks @@ -204,14 +211,21 @@ namespace timeline { void open() override { +// style_->context_save(); // <<<---does not work. Asked on SO: https://stackoverflow.com/q/57342478 style_->add_class (slopeClassName (1)); int slopeWidth = style_->get_border().get_top(); - style_->render_frame (cox_ - ,visible_.b // left start of the rectangle - ,line_ // top of the rectangle - ,visible_.delta() // width of the area - ,2*slopeWidth // height to fill + style_->render_frame_gap(cox_ + ,visible_.b + +25 ////////////////////////////////////////TODO: visual debugging + ,line_ + ,visible_.delta() + ,2*slopeWidth + //_______________________________we only need the top side of the frame + ,Gtk::PositionType::POS_BOTTOM + ,visible_.b + ,visible_.e ); +// style_->context_restore(); // <<<---does not work... style_->remove_class (slopeClassName(1)); line_ += slopeWidth; } @@ -223,23 +237,22 @@ namespace timeline { { // style_->context_save(); // <<<---does not work. Asked on SO: https://stackoverflow.com/q/57342478 style_->add_class (slopeClassName(n)); - style_->invalidate(); int slopeWidth = style_->get_border().get_bottom(); - INFO(stage, "n=%d class=%s -->slopeWidth=%d", n, util::cStr(slopeClassName(n)), slopeWidth); + line_ -= slopeWidth; // set back to create room for the (invisible) top side of the frame style_->render_frame_gap(cox_ ,visible_.b - +20 ////////////////////////////////////////TODO: visual debugging + +30 ////////////////////////////////////////TODO: visual debugging ,line_ ,visible_.delta() - ,slopeWidth - * 5 ////////////////////////////////////////TODO: visual debugging + ,2*slopeWidth + //_______________________________we only need the bottom side of the frame ,Gtk::PositionType::POS_TOP ,visible_.b ,visible_.e ); // style_->context_restore(); // <<<---does not work... style_->remove_class (slopeClassName(n)); - line_ += slopeWidth; + line_ += 2*slopeWidth; } public: diff --git a/wiki/renderengine.html b/wiki/renderengine.html index 075a8bd63..ba9334c5c 100644 --- a/wiki/renderengine.html +++ b/wiki/renderengine.html @@ -3524,7 +3524,7 @@ In accordance with the Lumiera application architecture in general, the UI is no
A specially configured LumieraPlugin, which actually contains or loads the complete code of the (GTK)GUI, and additionally is linked dynamically against the application core lib. During the [[UI startup process|GuiStart]], loading of this Plugin is triggered from {{{main()}}}. Actually this causes spawning of the GTK event thread and execution of the GTK main loop.
 
-
+
The presentation of the track body area relies on the [[Gtk::Layout "canvas widget"|GtkLayoutWidget]], thus allowing for a mixture of custom drawing with embedded custom Gtk widgets. The actual drawing routine is activated in response to the {{{on_draw}}} signal -- and invoking the inherited handler function will initiate the standard drawing for the embedded child widgets. This partitions the additional, specific drawing activities into a pre-widget drawing phase to prepare the background and framework structure of the track area, and a post-widget drawing phase to show all kinds of overlays, markers cursors and similar UI indicators. A nested structure of {{{TrackBody}}} objects serves as organisational device to structure these custom drawing activities in accordance with the nested structure of the track fork.
 
 !Building a nested 3D structure
@@ -3553,7 +3553,7 @@ Once the fundamental decision towards a 3D structure is taken, there still is so
 * shading can indicate a //slope// up or down.
 An immediate consequence to draw from this observation is that ~CSS3 effects are only of limited use for this purpose. They are more helpful to highlight compact and local structures, like a menu button, or some element or handle on the clips. We can (and likely will) use CSS shading for the [[track overview rulers|TrackRuler]] though. We possibly could use a slight inset box shadow within the actual track content area. However, it is rather pointless to use a box shadow to paint the nested track scope insets -- we rather need to rely on gradients and direct colour shading for that purpose.
 
-Another consequence  is that we do not need to apply an overall "stacked boxes" approach -- there is not much to gain from doing so (and we would do a lot of unnecessary filling operations, most of which will actually clipped away). For that reason, we define our ''track profile'' to represent a vertical //top-down drawing sweep.// Non the less, the actual colours and shades can be defined completely through CSS rules. To achieve this, we apply some tricks
+Another consequence  is that we do not need to apply an overall "stacked boxes" approach -- there is not much to gain from doing so (and we would do a lot of unnecessary filling operations, most of which will actually be clipped away). For that reason, we define our ''track profile'' to represent a vertical //top-down drawing sweep.// Non the less, the actual colours and shades can be defined completely through CSS rules. To achieve this, we apply some tricks
 * we define //virtual widgets,// which are only used to match against selectors and pick up the attached CSS styles
 ** the virtual element {{{fork}}} represents "a timeline track"
 ** and a virtual {{{frame}}} element nested therein represents "a ruler on top of a timeline track"
@@ -3564,11 +3564,18 @@ Another consequence  is that we do not need to apply an overall "stacked bo
 *:* a {{{margin}}} at top will add additional space between consecutive tracks
 *:* while the {{{padding}}} will be used within the track content area -- <br/> of course only in vertical direction, since the horizontal extension is ruled by the time position of elements within the track
 *:* please note that {{{background}}} stylings apply to the //content area// and not the track space at a whole.
+*:* especially a {{{box shadow}}} will be drawn when filling the background of the content area -- however, only an {{{inset}}} makes sense here,<br/>since a regular (outer) box shadow will be covered by consecutive drawing actions...
 *;track ruler
 *:attach rules to the selector{{{fork.timeline__fork frame.timeline__ruler}}}
 *:* again the {{{border top}}} and {{{border bottom}}} settings will delimit the ruler form the other track content
 *:* while {{{margin}}} and {{{padding}}} apply as usual outside and within the border
-*:* here the {{{box shadow}}} will be drawn with the background -- however, only an {{{inset}}} makes sense here,<br/>since a regular (outer) box shadow will be covered by consecutive drawing actions, unless it sticks within the limits of the {{{margin}}}
+*:* here the {{{box shadow}}} will be drawn with the background and aligned with the frame -- and again, only an {{{inset}}} really makes sense,<br/>while a regular (outer) box shadow must be small enough to stick within the limits of the {{{margin}}}
+*;slopes
+*:we use several classes to define the effect of consecutive nested frames forming a common slope; however, we perform this combination effect only 5 steps deep
+*:* we use class {{{.track-slope--deep1}}} for a simple slope (inset by one nested level)
+*:* class {{{.track-slope--deep2}}} for two consecutive nested steps combined. Note this only ever happens on closing (upward) slopes
+*:* likewise class {{{.track-slope--deep3}}} for three and class {{{.track-slope--deep4}}} for four combined slopes
+*:* finally, class {{{.track-slope--verydeep}}} is used for five and more combined upward (closing) slopes
 
 Please note also that our drawing code operates in several ''passes''. First, a ''background'' pass is used to fill the area, then GTK is invoked recursively for any widgets on the dawing canvas, most notably the ''clips''. Then, a final ''overlay'' pass allows to paint range markers, selections and indicators on top.
 
diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 524758441..31c22a940 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -21912,6 +21912,9 @@ + + + @@ -22723,7 +22726,11 @@ - + + + + + @@ -22750,7 +22757,25 @@ - + + + + + + + + +

+ ...anstatt für jeden schließenden nested scope noch ein weiteres Verb hinzuzufügen. +

+

+ Damit werden effektiv die "schließenden Klammern" in eine einzige zusammengefaßt +

+ + +
+
+
@@ -22890,6 +22915,23 @@ + + + + + + + +

+ ist ineffizient, aber der Code ist so klarer +

+ + +
+
+ + +
@@ -23090,6 +23132,10 @@ + + + +
@@ -23155,7 +23201,7 @@
- + @@ -23167,7 +23213,8 @@ - + + @@ -23459,8 +23506,16 @@ - + + + + + + + + + @@ -23758,9 +23813,9 @@
- + - + @@ -23806,6 +23861,20 @@ + + + + + + + + + + + + + +