Browse Source

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.
tags/2021-05-28
reuk 4 years ago
parent
commit
36664cc487
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      modules/juce_gui_basics/native/juce_mac_FileChooser.mm

+ 5
- 2
modules/juce_gui_basics/native/juce_mac_FileChooser.mm 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;
}


Loading…
Cancel
Save