diff --git a/research/gtk-style-experiment.cpp b/research/gtk-style-experiment.cpp index ffc11f85c..466919197 100644 --- a/research/gtk-style-experiment.cpp +++ b/research/gtk-style-experiment.cpp @@ -44,6 +44,7 @@ #include "lib/error.hpp" #include "lib/util.hpp" +#include ////////////////////TODO WIP #include using util::cStr; @@ -218,6 +219,7 @@ namespace research { Gtk::WidgetPath path = srcWidget.get_path(); PStyleContext style = Gtk::StyleContext::create(); + style->set_screen(Gdk::Screen::get_default()); style->set_path(path); // style->add_class(slopeClassName(2)); return style; @@ -317,8 +319,14 @@ namespace research { { int marT = style_->get_margin().get_top(); + auto path = style_->get_path(); + if (xBorderSiz > 1) { - style_->context_save(); +// style_->invalidate(); +// style_->context_save(); +// style_->set_screen(Gdk::Screen::get_default()); +// style_->set_path(path); +// style_->invalidate(); style_->add_class(slopeClassName(xBorderSiz)); } @@ -335,7 +343,8 @@ namespace research { ); if (xBorderSiz > 1) { - style_->context_restore(); +// style_->context_restore(); + style_->remove_class(slopeClassName(xBorderSiz)); } } //////////////////TEST drawing via Gtk::StyleContext diff --git a/src/stage/timeline/body-canvas-widget.cpp b/src/stage/timeline/body-canvas-widget.cpp index 09b1569bf..b4f2c6753 100644 --- a/src/stage/timeline/body-canvas-widget.cpp +++ b/src/stage/timeline/body-canvas-widget.cpp @@ -219,7 +219,7 @@ namespace timeline { void close (uint n) override { -// style_->context_save(); +// 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(); @@ -235,8 +235,8 @@ namespace timeline { ,visible_.b ,visible_.e ); +// style_->context_restore(); // <<<---does not work... style_->remove_class (slopeClassName(n)); -// style_->context_restore(); line_ += slopeWidth; } diff --git a/src/stage/workspace/ui-style.cpp b/src/stage/workspace/ui-style.cpp index 6839ce0ad..06b3b4a95 100644 --- a/src/stage/workspace/ui-style.cpp +++ b/src/stage/workspace/ui-style.cpp @@ -139,6 +139,7 @@ namespace workspace { for (int i=0; iset_screen(Gdk::Screen::get_default()); style->set_path (path); styleAdviceTrackBody_.setAdvice (style); // publish as Advice "style(trackBody)" INFO (stage, "Body-CSS: path=%s", util::cStr (path.to_string())); ////////////////////////TICKET #1201 : this yields "paned:dir-ltr.horizontal box:dir-ltr.vertical TrackScope.timeline" diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index dede9aef4..40a4b9859 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -23026,10 +23026,58 @@ - - + + + + + + + + +

+ Wenn man einen neuen Gtk::StyleContext erzeugt, +

+

+ und (wie in der Doku beschrieben) den path und den screen manuell setzt, +

+

+ dann führt ein context_save() dazu, daß plötzlich die CSS-Werte auf Defaults zurückspringen +

+ + +
- + + + + + + +

+ und ja, den Screen sollte man generell setzten.
Steht auch so in der Doku. +

+

+ +

+

+ Allerdings hat es bisher auch ohne das bei mir funktioniert. +

+ + +
+ +
+ + + + + + + + + +
+