diff --git a/extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp b/extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp index 33b6627a5f..91d63ad227 100644 --- a/extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp +++ b/extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp @@ -37,16 +37,16 @@ namespace AppearanceColours static const ColourInfo colours[] = { + { "Main Window Bkgd", mainBackgroundColourId, true }, + { "Project Panel Bkgd", projectPanelBackgroundColourId, true }, + { "Treeview Highlight", treeviewHighlightColourId, false }, + { "Code Background", CodeEditorComponent::backgroundColourId, true }, { "Line Number Bkgd", CodeEditorComponent::lineNumberBackgroundId, false }, { "Line Numbers", CodeEditorComponent::lineNumberTextId, false }, { "Plain Text", CodeEditorComponent::defaultTextColourId, false }, { "Selected Text Bkgd", CodeEditorComponent::highlightColourId, false }, - { "Caret", CaretComponent::caretColourId, false }, - - { "Main Window Bkgd", mainBackgroundColourId, true }, - { "Project Panel Bkgd", projectPanelBackgroundColourId, true }, - { "Treeview Highlight", treeviewHighlightColourId, false } + { "Caret", CaretComponent::caretColourId, false } }; } @@ -120,16 +120,22 @@ bool AppearanceSettings::readFromXML (const XmlElement& xml) { if (xml.hasTagName (settings.getType().toString())) { - ValueTree newSettings (ValueTree::fromXml (xml)); + const ValueTree newSettings (ValueTree::fromXml (xml)); + + // we'll manually copy across the new properties to the existing tree so that + // any open editors will be kept up to date.. + settings.copyPropertiesFrom (newSettings, nullptr); for (int i = settings.getNumChildren(); --i >= 0;) { - const ValueTree c (settings.getChild (i)); - if (! newSettings.getChildWithProperty (Ids::name, c.getProperty (Ids::name)).isValid()) - newSettings.addChild (c.createCopy(), 0, nullptr); + ValueTree c (settings.getChild (i)); + + const ValueTree newValue (newSettings.getChildWithProperty (Ids::name, c.getProperty (Ids::name))); + + if (newValue.isValid()) + c.copyPropertiesFrom (newValue, nullptr); } - settings = newSettings; return true; } diff --git a/extras/Introjucer/Source/Utility/jucer_JucerTreeViewBase.cpp b/extras/Introjucer/Source/Utility/jucer_JucerTreeViewBase.cpp index efdc36494a..59c65c0629 100644 --- a/extras/Introjucer/Source/Utility/jucer_JucerTreeViewBase.cpp +++ b/extras/Introjucer/Source/Utility/jucer_JucerTreeViewBase.cpp @@ -66,7 +66,7 @@ void JucerTreeViewBase::paintOpenCloseButton (Graphics& g, int width, int height else p.addTriangle (width * 0.25f, height * 0.25f, width * 0.8f, height * 0.5f, width * 0.25f, height * 0.75f); - g.setColour (getContrastingColour (0.3f)); + g.setColour (getOwnerView()->findColour (projectPanelBackgroundColourId).contrasting (0.3f)); g.fillPath (p); }