mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-08 04:20:09 +00:00
Added method Component::unfocusAllComponents()
This commit is contained in:
parent
39c44c12ed
commit
9a1171a7ef
2 changed files with 7 additions and 0 deletions
|
|
@ -2820,6 +2820,12 @@ Component* JUCE_CALLTYPE Component::getCurrentlyFocusedComponent() noexcept
|
|||
return currentlyFocusedComponent;
|
||||
}
|
||||
|
||||
void JUCE_CALLTYPE Component::unfocusAllComponents()
|
||||
{
|
||||
if (Component* c = getCurrentlyFocusedComponent())
|
||||
c->giveAwayFocus (true);
|
||||
}
|
||||
|
||||
void Component::giveAwayFocus (const bool sendFocusLossEvent)
|
||||
{
|
||||
Component* const componentLosingFocus = currentlyFocusedComponent;
|
||||
|
|
|
|||
|
|
@ -1250,6 +1250,7 @@ public:
|
|||
*/
|
||||
static Component* JUCE_CALLTYPE getCurrentlyFocusedComponent() noexcept;
|
||||
|
||||
/** If any component has keyboard focus, this will defocus it. */
|
||||
static void JUCE_CALLTYPE unfocusAllComponents();
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue