Browse Source

Added ComboBox::ColourIds::focusedOutlineColourId

tags/2021-05-28
ed 7 years ago
parent
commit
a40f6b3e5e
4 changed files with 11 additions and 9 deletions
  1. +2
    -1
      modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp
  2. +2
    -3
      modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp
  3. +1
    -0
      modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp
  4. +6
    -5
      modules/juce_gui_basics/widgets/juce_ComboBox.h

+ 2
- 1
modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp View File

@@ -112,6 +112,7 @@ LookAndFeel_V2::LookAndFeel_V2()
ComboBox::textColourId, 0xff000000,
ComboBox::backgroundColourId, 0xffffffff,
ComboBox::arrowColourId, 0x99000000,
ComboBox::focusedOutlineColourId, 0xffbbbbff,
PropertyComponent::backgroundColourId, 0x66ffffff,
PropertyComponent::labelTextColourId, 0xff000000,
@@ -1167,7 +1168,7 @@ void LookAndFeel_V2::drawComboBox (Graphics& g, int width, int height, const boo
if (box.isEnabled() && box.hasKeyboardFocus (false))
{
g.setColour (box.findColour (ComboBox::buttonColourId));
g.setColour (box.findColour (ComboBox::focusedOutlineColourId));
g.drawRect (0, 0, width, height, 2);
}
else


+ 2
- 3
modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp View File

@@ -35,6 +35,7 @@ LookAndFeel_V3::LookAndFeel_V3()
setColour (TextButton::buttonColourId, textButtonColour);
setColour (TextButton::buttonOnColourId, Colour (0xff888888));
setColour (ComboBox::buttonColourId, textButtonColour);
setColour (ComboBox::focusedOutlineColourId, textButtonColour);
setColour (TextEditor::outlineColourId, Colours::transparentBlack);
setColour (TabbedButtonBar::tabOutlineColourId, Colour (0x66000000));
setColour (TabbedComponent::outlineColourId, Colour (0x66000000));
@@ -357,11 +358,9 @@ void LookAndFeel_V3::drawComboBox (Graphics& g, int width, int height, const boo
{
g.fillAll (box.findColour (ComboBox::backgroundColourId));
const Colour buttonColour (box.findColour (ComboBox::buttonColourId));
if (box.isEnabled() && box.hasKeyboardFocus (false))
{
g.setColour (buttonColour);
g.setColour (box.findColour (ComboBox::focusedOutlineColourId));
g.drawRect (0, 0, width, height, 2);
}
else


+ 1
- 0
modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp View File

@@ -1343,6 +1343,7 @@ void LookAndFeel_V4::initialiseColours()
ComboBox::textColourId, currentColourScheme.getUIColour (ColourScheme::UIColour::defaultText).getARGB(),
ComboBox::backgroundColourId, currentColourScheme.getUIColour (ColourScheme::UIColour::widgetBackground).getARGB(),
ComboBox::arrowColourId, currentColourScheme.getUIColour (ColourScheme::UIColour::defaultText).getARGB(),
ComboBox::focusedOutlineColourId, currentColourScheme.getUIColour (ColourScheme::UIColour::outline).getARGB(),
PropertyComponent::backgroundColourId, currentColourScheme.getUIColour (ColourScheme::UIColour::widgetBackground).getARGB(),
PropertyComponent::labelTextColourId, currentColourScheme.getUIColour (ColourScheme::UIColour::defaultText).getARGB(),


+ 6
- 5
modules/juce_gui_basics/widgets/juce_ComboBox.h View File

@@ -347,11 +347,12 @@ public:
*/
enum ColourIds
{
backgroundColourId = 0x1000b00, /**< The background colour to fill the box with. */
textColourId = 0x1000a00, /**< The colour for the text in the box. */
outlineColourId = 0x1000c00, /**< The colour for an outline around the box. */
buttonColourId = 0x1000d00, /**< The base colour for the button (a LookAndFeel class will probably use variations on this). */
arrowColourId = 0x1000e00, /**< The colour for the arrow shape that pops up the menu */
backgroundColourId = 0x1000b00, /**< The background colour to fill the box with. */
textColourId = 0x1000a00, /**< The colour for the text in the box. */
outlineColourId = 0x1000c00, /**< The colour for an outline around the box. */
buttonColourId = 0x1000d00, /**< The base colour for the button (a LookAndFeel class will probably use variations on this). */
arrowColourId = 0x1000e00, /**< The colour for the arrow shape that pops up the menu */
focusedOutlineColourId = 0x1000f00 /**< The colour that will be used to draw a box around the edge of the component when it has focus. */
};
//==============================================================================


Loading…
Cancel
Save