From 5af55a1409362bdb4b6ec7e12552786b6088fafe Mon Sep 17 00:00:00 2001 From: Richard Harrison Date: Sun, 15 Oct 2017 21:49:40 +0200 Subject: [PATCH] Copy currently selected gui style tree to sim/gui/selected-style This makes it considerably easier to reference an item from the currently selected style without having to lookup the selected style index and then use that to select the appropriate element from the styles/ tree --- src/GUI/new_gui.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/GUI/new_gui.cxx b/src/GUI/new_gui.cxx index 05917c980..a2d6b3979 100644 --- a/src/GUI/new_gui.cxx +++ b/src/GUI/new_gui.cxx @@ -413,6 +413,13 @@ NewGUI::setStyle (void) SGPropertyNode *n = sim->getChild("style", which); if (!n) n = sim->getChild("style", 0, true); + + SGPropertyNode *selected_style = globals->get_props()->getNode("sim/gui/selected-style", true); + + n->copy(selected_style); + + //if (selected_style && n) + // n->alias(selected_style); setupFont(n->getNode("fonts/gui", true)); n = n->getNode("colors", true);