1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added some colour ID constants for PropertyComponent.

This commit is contained in:
jules 2014-02-17 17:55:15 +00:00
parent 7ae92cf1ba
commit a5cc0d492e
2 changed files with 24 additions and 9 deletions

View file

@ -104,6 +104,9 @@ LookAndFeel_V2::LookAndFeel_V2()
ComboBox::backgroundColourId, 0xffffffff,
ComboBox::arrowColourId, 0x99000000,
PropertyComponent::backgroundColourId, 0x66ffffff,
PropertyComponent::labelTextColourId, 0xff000000,
TextPropertyComponent::backgroundColourId, 0xffffffff,
TextPropertyComponent::textColourId, 0xff000000,
TextPropertyComponent::outlineColourId, standardOutlineColour,
@ -2302,20 +2305,16 @@ void LookAndFeel_V2::drawPropertyPanelSectionHeader (Graphics& g, const String&
g.drawText (name, textX, 0, width - textX - 4, height, Justification::centredLeft, true);
}
void LookAndFeel_V2::drawPropertyComponentBackground (Graphics& g, int width, int height,
PropertyComponent&)
void LookAndFeel_V2::drawPropertyComponentBackground (Graphics& g, int width, int height, PropertyComponent& component)
{
g.setColour (Colour (0x66ffffff));
g.setColour (component.findColour (PropertyComponent::backgroundColourId));
g.fillRect (0, 0, width, height - 1);
}
void LookAndFeel_V2::drawPropertyComponentLabel (Graphics& g, int, int height,
PropertyComponent& component)
void LookAndFeel_V2::drawPropertyComponentLabel (Graphics& g, int, int height, PropertyComponent& component)
{
g.setColour (Colours::black);
if (! component.isEnabled())
g.setOpacity (0.6f);
g.setColour (component.findColour (PropertyComponent::labelTextColourId)
.withMultipliedAlpha (component.isEnabled() ? 1.0f : 0.6f));
g.setFont (jmin (height, 24) * 0.65f);

View file

@ -102,6 +102,22 @@ public:
/** By default, this just repaints the component. */
void enablementChanged() override;
//==============================================================================
/** A set of colour IDs to use to change the colour of various aspects of the combo box.
These constants can be used either via the Component::setColour(), or LookAndFeel::setColour()
methods.
To change the colours of the menu that pops up
@see Component::setColour, Component::findColour, LookAndFeel::setColour, LookAndFeel::findColour
*/
enum ColourIds
{
backgroundColourId = 0x1008300, /**< The background colour to fill the component with. */
labelTextColourId = 0x1008301, /**< The colour for the property's label text. */
};
//==============================================================================
/** This abstract base class is implemented by LookAndFeel classes. */
struct JUCE_API LookAndFeelMethods