diff --git a/build/linux/platform_specific_code/juce_linux_SystemStats.cpp b/build/linux/platform_specific_code/juce_linux_SystemStats.cpp index 71609f519a..d986af6fbe 100644 --- a/build/linux/platform_specific_code/juce_linux_SystemStats.cpp +++ b/build/linux/platform_specific_code/juce_linux_SystemStats.cpp @@ -323,13 +323,13 @@ uint32 juce_millisecondsSinceStartup() throw() double Time::getMillisecondCounterHiRes() throw() { - return getHighResolutionTicks() * (1.0 / 1000000.0); + return getHighResolutionTicks() * 0.001; } int64 Time::getHighResolutionTicks() throw() { timeval t; - if (gettimeofday (&t,NULL)) + if (gettimeofday (&t, 0)) return 0; return ((int64) t.tv_sec * (int64) 1000000) + (int64) t.tv_usec; diff --git a/src/juce_appframework/gui/components/layout/juce_StretchableLayoutManager.cpp b/src/juce_appframework/gui/components/layout/juce_StretchableLayoutManager.cpp index 039494c780..9986292ab0 100644 --- a/src/juce_appframework/gui/components/layout/juce_StretchableLayoutManager.cpp +++ b/src/juce_appframework/gui/components/layout/juce_StretchableLayoutManager.cpp @@ -100,12 +100,9 @@ bool StretchableLayoutManager::getItemLayout (const int itemIndex, //============================================================================== void StretchableLayoutManager::setTotalSize (const int newTotalSize) { - if (totalSize != newTotalSize) - { - totalSize = newTotalSize; + totalSize = newTotalSize; - fitComponentsIntoSpace (0, items.size(), totalSize, 0); - } + fitComponentsIntoSpace (0, items.size(), totalSize, 0); } int StretchableLayoutManager::getItemCurrentPosition (const int itemIndex) const diff --git a/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp b/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp index 92772e5320..12551304a2 100644 --- a/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp +++ b/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp @@ -66,6 +66,7 @@ BEGIN_JUCE_NAMESPACE #include "../../graphics/drawables/juce_DrawablePath.h" #include "../../../../juce_core/text/juce_LocalisedStrings.h" #include "../special/juce_MidiKeyboardComponent.h" +#include "../special/juce_ColourSelector.h" //============================================================================== @@ -188,7 +189,10 @@ LookAndFeel::LookAndFeel() MidiKeyboardComponent::keyDownOverlayColourId, 0xffb6b600, MidiKeyboardComponent::textLabelColourId, 0xff000000, MidiKeyboardComponent::upDownButtonBackgroundColourId, 0xffd3d3d3, - MidiKeyboardComponent::upDownButtonArrowColourId, 0xff000000 + MidiKeyboardComponent::upDownButtonArrowColourId, 0xff000000, + + ColourSelector::backgroundColourId, 0xffe5e5e5, + ColourSelector::labelTextColourId, 0xff000000 }; for (int i = 0; i < numElementsInArray (standardColours); i += 2) diff --git a/src/juce_appframework/gui/components/special/juce_ColourSelector.cpp b/src/juce_appframework/gui/components/special/juce_ColourSelector.cpp index 0a8412d77b..338d9c3c70 100644 --- a/src/juce_appframework/gui/components/special/juce_ColourSelector.cpp +++ b/src/juce_appframework/gui/components/special/juce_ColourSelector.cpp @@ -473,8 +473,8 @@ void ColourSelector::update() //============================================================================== void ColourSelector::paint (Graphics& g) { - g.fillAll (Colour::greyLevel (0.9f)); - + g.fillAll (findColour (backgroundColourId)); + if ((flags & showColourAtTop) != 0) { const Colour colour (getCurrentColour()); @@ -502,7 +502,7 @@ void ColourSelector::paint (Graphics& g) if ((flags & showSliders) != 0) { - g.setColour (Colours::black); + g.setColour (findColour (labelTextColourId)); g.setFont (11.0f); for (int i = 4; --i >= 0;) diff --git a/src/juce_appframework/gui/components/special/juce_ColourSelector.h b/src/juce_appframework/gui/components/special/juce_ColourSelector.h index f2badc3202..3d2964dec1 100644 --- a/src/juce_appframework/gui/components/special/juce_ColourSelector.h +++ b/src/juce_appframework/gui/components/special/juce_ColourSelector.h @@ -122,6 +122,22 @@ public: */ virtual void setSwatchColour (const int index, const Colour& newColour) const; + + //============================================================================== + /** A set of colour IDs to use to change the colour of various aspects of the keyboard. + + These constants can be used either via the Component::setColour(), or LookAndFeel::setColour() + methods. + + @see Component::setColour, Component::findColour, LookAndFeel::setColour, LookAndFeel::findColour + */ + enum ColourIds + { + backgroundColourId = 0x1007000, /**< the colour used to fill the component's background. */ + labelTextColourId = 0x1007001 /**< the colour used for the labels next to the sliders. */ + }; + + //============================================================================== juce_UseDebuggingNewOperator diff --git a/src/juce_core/text/juce_XmlDocument.cpp b/src/juce_core/text/juce_XmlDocument.cpp index 24db693497..4368f31df8 100644 --- a/src/juce_core/text/juce_XmlDocument.cpp +++ b/src/juce_core/text/juce_XmlDocument.cpp @@ -475,7 +475,7 @@ XmlElement* XmlDocument::readNextElement (const bool alsoParseSubElements) throw else { if (! outOfData) - setLastError ("illegal characters found", false); + setLastError ("illegal character found in " + node->getTagName() + ": '" + c + "'", false); } break; diff --git a/src/juce_core/text/juce_XmlElement.cpp b/src/juce_core/text/juce_XmlElement.cpp index 47b3adb36f..a615dd94ba 100644 --- a/src/juce_core/text/juce_XmlElement.cpp +++ b/src/juce_core/text/juce_XmlElement.cpp @@ -1142,11 +1142,16 @@ const String XmlElement::getChildElementAllSubText (const tchar* const childTagN return defaultReturnValue; } -void XmlElement::addTextElement (const String& text) throw() +XmlElement* XmlElement::createTextElement (const String& text) throw() { XmlElement* const e = new XmlElement ((int) 0); e->setAttribute (juce_xmltextContentAttributeName, text); - addChildElement (e); + return e; +} + +void XmlElement::addTextElement (const String& text) throw() +{ + addChildElement (createTextElement (text)); } void XmlElement::deleteAllTextElements() throw() diff --git a/src/juce_core/text/juce_XmlElement.h b/src/juce_core/text/juce_XmlElement.h index a694d0b6a5..328412186a 100644 --- a/src/juce_core/text/juce_XmlElement.h +++ b/src/juce_core/text/juce_XmlElement.h @@ -644,6 +644,10 @@ public: */ void deleteAllTextElements() throw(); + /** Creates a text element that can be added to a parent element. + */ + static XmlElement* createTextElement (const String& text) throw(); + //============================================================================== juce_UseDebuggingNewOperator