1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-18 00:54:19 +00:00

FileChooser: Fix behaviour of macOS FilePreviewComponent

Previously, when the FileChooser::Native instance entered the
modal state, it was preventing the inner FilePreviewComponent from
receiving events.
This commit is contained in:
reuk 2020-10-19 17:19:32 +01:00
parent f09b2aa4f5
commit 36664cc487

View file

@ -97,11 +97,11 @@ public:
if (preview != nullptr)
{
nsViewPreview = [[NSView alloc] initWithFrame: makeNSRect (preview->getLocalBounds())];
[panel setAccessoryView: nsViewPreview];
preview->addToDesktop (0, (void*) nsViewPreview);
preview->setVisible (true);
[panel setAccessoryView: nsViewPreview];
if (! isSave)
{
auto* openPanel = static_cast<NSOpenPanel*> (panel);
@ -187,6 +187,9 @@ public:
if (targetComponent == nullptr)
return false;
if (targetComponent == preview)
return true;
return targetComponent->findParentComponentOfClass<FilePreviewComponent>() != nullptr;
}