Browse Source

Added some colour ID constants for PropertyComponent.

tags/2021-05-28
jules 11 years ago
parent
commit
a5cc0d492e
2 changed files with 24 additions and 9 deletions
  1. +8
    -9
      modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp
  2. +16
    -0
      modules/juce_gui_basics/properties/juce_PropertyComponent.h

+ 8
- 9
modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp 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);


+ 16
- 0
modules/juce_gui_basics/properties/juce_PropertyComponent.h 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


Loading…
Cancel
Save