Skip to content

Commit

Permalink
macOS: Use the NSOpenPanel message property to display the FileChoose…
Browse files Browse the repository at this point in the history
…r title correctly
  • Loading branch information
ed95 committed Jul 27, 2021
1 parent 6d53ed3 commit c5bcfd5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/juce_gui_basics/native/juce_mac_FileChooser.mm
Expand Up @@ -82,7 +82,9 @@ Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
filters.trim();
filters.removeEmptyStrings();

[panel setTitle: juceStringToNS (owner.title)];
NSString* nsTitle = juceStringToNS (owner.title);
[panel setTitle: nsTitle];

JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
[panel setAllowedFileTypes: createAllowedTypesArray (filters)];
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
Expand All @@ -95,6 +97,7 @@ Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
[openPanel setCanChooseFiles: selectsFiles];
[openPanel setAllowsMultipleSelection: selectMultiple];
[openPanel setResolvesAliases: YES];
[openPanel setMessage: nsTitle]; // equivalent to the title bar since 10.11

if (owner.treatFilePackagesAsDirs)
[openPanel setTreatsFilePackagesAsDirectories: YES];
Expand All @@ -118,7 +121,7 @@ Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
if (isSave || selectsDirectories)
[panel setCanCreateDirectories: YES];

[panel setLevel:NSModalPanelWindowLevel];
[panel setLevel: NSModalPanelWindowLevel];

if (owner.startingFile.isDirectory())
{
Expand Down

0 comments on commit c5bcfd5

Please sign in to comment.