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)")) noChoicesMessage (TRANS("(no choices)"))
{ {
setRepaintsOnMouseActivity (true); setRepaintsOnMouseActivity (true);
ComboBox::lookAndFeelChanged();
currentId.addListener (this); currentId.addListener (this);
} }
@@ -410,12 +409,22 @@ void ComboBox::enablementChanged()
repaint(); repaint();
} }
void ComboBox::colourChanged()
{
lookAndFeelChanged();
}
void ComboBox::parentHierarchyChanged()
{
lookAndFeelChanged();
}
void ComboBox::lookAndFeelChanged() void ComboBox::lookAndFeelChanged()
{ {
repaint(); repaint();
{ {
ScopedPointer <Label> newLabel (getLookAndFeel().createComboBoxTextBox (*this));
ScopedPointer<Label> newLabel (getLookAndFeel().createComboBoxTextBox (*this));
jassert (newLabel != nullptr); jassert (newLabel != nullptr);
if (label != nullptr) if (label != nullptr)
@@ -446,11 +455,6 @@ void ComboBox::lookAndFeelChanged()
resized(); resized();
} }
void ComboBox::colourChanged()
{
lookAndFeelChanged();
}
//============================================================================== //==============================================================================
bool ComboBox::keyPressed (const KeyPress& key) 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; bool keyPressed (const KeyPress&) override;
/** @internal */ /** @internal */
void valueChanged (Value&) override; void valueChanged (Value&) override;
/** @internal */
void parentHierarchyChanged() override;
// These methods' bool parameters have changed: see their new method signatures. // These methods' bool parameters have changed: see their new method signatures.
JUCE_DEPRECATED (void clear (bool)); JUCE_DEPRECATED (void clear (bool));


Loading…
Cancel
Save