From 4785ff8caa7136ed6431b3ca8cb64b7758db586f Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 5 Sep 2019 15:30:01 +0200 Subject: [PATCH] Timeline: integrate support for a margin on the timeline content ...which has the nice additional effect of exposing box-shadow on the outside of the content area too. Thus the content area now behaves equivalent to the rulers, and adjacent content space of simple tracks without rulers and nesting can be slightly offset from each other through a margin in CSS --- src/stage/lumiera-light-theme-complement.css | 5 + src/stage/timeline/body-canvas-widget.cpp | 11 +- src/stage/timeline/track-body.cpp | 2 +- wiki/thinkPad.ichthyo.mm | 142 +++++++++++++++++-- 4 files changed, 145 insertions(+), 15 deletions(-) diff --git a/src/stage/lumiera-light-theme-complement.css b/src/stage/lumiera-light-theme-complement.css index e4f72f7a0..f0b503dfc 100644 --- a/src/stage/lumiera-light-theme-complement.css +++ b/src/stage/lumiera-light-theme-complement.css @@ -45,11 +45,16 @@ border-style: inset; border-color: IndianRed; background-color: Lime; + box-shadow: inset 2px 2px 5px 1px DeepSkyBlue, + 5px 5px 2px 1px ForestGreen; } fork.timeline__fork frame.timeline__ruler { margin: 1ex; + padding: 5px; border: 3px outset GoldenRod; background-color: DarkCyan; + box-shadow: inset 2px 2px 5px 1px DeepSkyBlue, + 5px 5px 2px 10px DarkGoldenRod; } .track-slope--deep1 { border-width: 5px; diff --git a/src/stage/timeline/body-canvas-widget.cpp b/src/stage/timeline/body-canvas-widget.cpp index 7bf163c88..c0f7b9273 100644 --- a/src/stage/timeline/body-canvas-widget.cpp +++ b/src/stage/timeline/body-canvas-widget.cpp @@ -112,7 +112,9 @@ namespace timeline { + styleRuler->get_padding().get_top() + styleRuler->get_padding().get_bottom() ; - TrackBody::decoration.content = styleBody->get_padding().get_top() + TrackBody::decoration.content = styleBody->get_margin().get_top() + + styleBody->get_margin().get_bottom() + + styleBody->get_padding().get_top() + styleBody->get_padding().get_bottom() ; TrackBody::decoration.topMar = styleBody->get_margin().get_top(); @@ -191,7 +193,7 @@ namespace timeline { } /** finish painting the track body area - * @param pad additional padding to add at bottom */ + * @param pad additional padding (in px) to add at bottom */ void coda (uint pad) override { @@ -238,11 +240,16 @@ namespace timeline { void content (uint contentHeight) override { + int marTop = style_->get_margin().get_top(); + int marBot = style_->get_margin().get_bottom(); int padTop = style_->get_padding().get_top(); int padBot = style_->get_padding().get_bottom(); int heightWithPadding = contentHeight + padTop+padBot; + + line_ += marTop; fillBackground (style_, heightWithPadding); line_ += heightWithPadding; + line_ += marBot; } /** paint opening slope to enter nested sub tracks diff --git a/src/stage/timeline/track-body.cpp b/src/stage/timeline/track-body.cpp index 3700e83b5..d681045c1 100644 --- a/src/stage/timeline/track-body.cpp +++ b/src/stage/timeline/track-body.cpp @@ -105,7 +105,7 @@ namespace timeline { /** * recursively calculate the height in pixels to display this track, - * including all nested sub-tracks + * including all nested sub-tracks and possibly decoration/padding from CSS */ uint TrackBody::calcHeight() diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index fdccb8715..34860d308 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -22867,8 +22867,8 @@ - + @@ -23853,6 +23853,9 @@ + + + @@ -23881,23 +23884,28 @@ - + + + + + + + - - - - - - - + + + + + + @@ -23946,8 +23954,8 @@ - + @@ -24057,7 +24065,7 @@ - + @@ -24077,7 +24085,72 @@ - + + + + + + + + + + + + + + +

+ macht ggfs ganz natürlich einen box-shadow sichtbar +

+ + +
+ +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -24151,6 +24224,51 @@ + + + + + + + + + + + + + + + + + +

+ er wird von GTK eigentlich korrekt über die Nachbarbereiche darüber gezeichnet. +

+

+ Aber an der Nahtstelle entsteht ein helle Linie von 1/2 Pixel Breite, +

+

+ die sich nur beim Scrollen bemerkbar macht +

+ + +
+
+ + + + + + +

+ man soll ohnehin keinen so großen box-shadow verwenden +

+ + +
+
+
+