diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 3322f16a42..ada0849df6 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -43932,7 +43932,9 @@ void DrawableButton::paintButton (Graphics& g, { g.setFont ((float) textH); - g.setColour (Colours::black.withAlpha (isEnabled() ? 1.0f : 0.4f)); + g.setColour (getLookAndFeel().findColour (DrawableButton::textColourId) + .withMultipliedAlpha (isEnabled() ? 1.0f : 0.4f)); + g.drawFittedText (getButtonText(), 2, getHeight() - textH - 1, getWidth() - 4, textH, @@ -60696,9 +60698,10 @@ const KeyPress KeyPress::createFromDescription (const String& desc) if (key == 0) { // see if it's a function key.. - for (int i = 1; i <= 12; ++i) - if (desc.containsWholeWordIgnoreCase ("f" + String (i))) - key = F1Key + i - 1; + if (! desc.containsChar ('#')) // avoid mistaking hex-codes like "#f1" + for (int i = 1; i <= 12; ++i) + if (desc.containsWholeWordIgnoreCase ("f" + String (i))) + key = F1Key + i - 1; if (key == 0) { @@ -64955,6 +64958,8 @@ LookAndFeel::LookAndFeel() FileSearchPathListComponent::backgroundColourId, 0xffffffff, FileChooserDialogBox::titleTextColourId, 0xff000000, + + DrawableButton::textColourId, 0xff000000, }; for (int i = 0; i < numElementsInArray (standardColours); i += 2) diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 3c925772d0..d16eb54c81 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -43832,6 +43832,18 @@ public: const Drawable* getOverImage() const throw(); const Drawable* getDownImage() const throw(); + /** A set of colour IDs to use to change the colour of various aspects of the link. + + 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 + { + textColourId = 0x1004010, /**< The colour to use for the URL text. */ + }; + juce_UseDebuggingNewOperator protected: diff --git a/src/gui/components/buttons/juce_DrawableButton.cpp b/src/gui/components/buttons/juce_DrawableButton.cpp index e1834c20d7..4a7fa3c354 100644 --- a/src/gui/components/buttons/juce_DrawableButton.cpp +++ b/src/gui/components/buttons/juce_DrawableButton.cpp @@ -173,7 +173,9 @@ void DrawableButton::paintButton (Graphics& g, { g.setFont ((float) textH); - g.setColour (Colours::black.withAlpha (isEnabled() ? 1.0f : 0.4f)); + g.setColour (getLookAndFeel().findColour (DrawableButton::textColourId) + .withMultipliedAlpha (isEnabled() ? 1.0f : 0.4f)); + g.drawFittedText (getButtonText(), 2, getHeight() - textH - 1, getWidth() - 4, textH, diff --git a/src/gui/components/buttons/juce_DrawableButton.h b/src/gui/components/buttons/juce_DrawableButton.h index 2ca860d241..1711bbefc9 100644 --- a/src/gui/components/buttons/juce_DrawableButton.h +++ b/src/gui/components/buttons/juce_DrawableButton.h @@ -153,6 +153,19 @@ public: const Drawable* getOverImage() const throw(); const Drawable* getDownImage() const throw(); + //============================================================================== + /** A set of colour IDs to use to change the colour of various aspects of the link. + + 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 + { + textColourId = 0x1004010, /**< The colour to use for the URL text. */ + }; + //============================================================================== juce_UseDebuggingNewOperator diff --git a/src/gui/components/keyboard/juce_KeyPress.cpp b/src/gui/components/keyboard/juce_KeyPress.cpp index 42f04748e5..b0ee39a386 100644 --- a/src/gui/components/keyboard/juce_KeyPress.cpp +++ b/src/gui/components/keyboard/juce_KeyPress.cpp @@ -193,9 +193,10 @@ const KeyPress KeyPress::createFromDescription (const String& desc) if (key == 0) { // see if it's a function key.. - for (int i = 1; i <= 12; ++i) - if (desc.containsWholeWordIgnoreCase ("f" + String (i))) - key = F1Key + i - 1; + if (! desc.containsChar ('#')) // avoid mistaking hex-codes like "#f1" + for (int i = 1; i <= 12; ++i) + if (desc.containsWholeWordIgnoreCase ("f" + String (i))) + key = F1Key + i - 1; if (key == 0) { diff --git a/src/gui/components/lookandfeel/juce_LookAndFeel.cpp b/src/gui/components/lookandfeel/juce_LookAndFeel.cpp index fdba8143f5..69f0ed5c2f 100644 --- a/src/gui/components/lookandfeel/juce_LookAndFeel.cpp +++ b/src/gui/components/lookandfeel/juce_LookAndFeel.cpp @@ -221,6 +221,8 @@ LookAndFeel::LookAndFeel() FileSearchPathListComponent::backgroundColourId, 0xffffffff, FileChooserDialogBox::titleTextColourId, 0xff000000, + + DrawableButton::textColourId, 0xff000000, }; for (int i = 0; i < numElementsInArray (standardColours); i += 2)