Browse Source

Made ComboBox update its L+F when reparented.

tags/2021-05-28
jules 11 years ago
parent
commit
fb3a3a0fb4
2 changed files with 13 additions and 7 deletions
  1. +11
    -7
      modules/juce_gui_basics/widgets/juce_ComboBox.cpp
  2. +2
    -0
      modules/juce_gui_basics/widgets/juce_ComboBox.h

+ 11
- 7
modules/juce_gui_basics/widgets/juce_ComboBox.cpp View File

@@ -49,7 +49,6 @@ ComboBox::ComboBox (const String& name)
noChoicesMessage (TRANS("(no choices)"))
{
setRepaintsOnMouseActivity (true);
ComboBox::lookAndFeelChanged();
currentId.addListener (this);
}
@@ -410,12 +409,22 @@ void ComboBox::enablementChanged()
repaint();
}
void ComboBox::colourChanged()
{
lookAndFeelChanged();
}
void ComboBox::parentHierarchyChanged()
{
lookAndFeelChanged();
}
void ComboBox::lookAndFeelChanged()
{
repaint();
{
ScopedPointer <Label> newLabel (getLookAndFeel().createComboBoxTextBox (*this));
ScopedPointer<Label> newLabel (getLookAndFeel().createComboBoxTextBox (*this));
jassert (newLabel != nullptr);
if (label != nullptr)
@@ -446,11 +455,6 @@ void ComboBox::lookAndFeelChanged()
resized();
}
void ComboBox::colourChanged()
{
lookAndFeelChanged();
}
//==============================================================================
bool ComboBox::keyPressed (const KeyPress& key)
{


+ 2
- 0
modules/juce_gui_basics/widgets/juce_ComboBox.h View File

@@ -393,6 +393,8 @@ public:
bool keyPressed (const KeyPress&) override;
/** @internal */
void valueChanged (Value&) override;
/** @internal */
void parentHierarchyChanged() override;
// These methods' bool parameters have changed: see their new method signatures.
JUCE_DEPRECATED (void clear (bool));


Loading…
Cancel
Save