Browse Source

Introjucer: saving swatch colours.

tags/2021-05-28
jules 13 years ago
parent
commit
71f2580f2b
2 changed files with 10 additions and 0 deletions
  1. +9
    -0
      extras/Introjucer/Source/Utility/jucer_StoredSettings.cpp
  2. +1
    -0
      extras/Introjucer/Source/Utility/jucer_StoredSettings.h

+ 9
- 0
extras/Introjucer/Source/Utility/jucer_StoredSettings.cpp View File

@@ -111,6 +111,7 @@ void StoredSettings::updateGlobalProps()
void StoredSettings::flush()
{
updateGlobalProps();
saveSwatchColours();
for (int i = propertyFiles.size(); --i >= 0;)
propertyFiles.getUnchecked(i)->saveIfNeeded();
@@ -179,6 +180,14 @@ void StoredSettings::loadSwatchColours()
colours [2 + i].toString())));
}
void StoredSettings::saveSwatchColours()
{
PropertiesFile& props = getGlobalProperties();
for (int i = 0; i < swatchColours.size(); ++i)
props.setValue ("swatchColour" + String (i), swatchColours.getReference(i).toString());
}
int StoredSettings::ColourSelectorWithSwatches::getNumSwatches() const
{
return getAppSettings().swatchColours.size();


+ 1
- 0
extras/Introjucer/Source/Utility/jucer_StoredSettings.h View File

@@ -71,6 +71,7 @@ private:
void updateGlobalProps();
void loadSwatchColours();
void saveSwatchColours();
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (StoredSettings)
};


Loading…
Cancel
Save