fix: allowed dialog file types with one filter (#46945)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
parent
7240a14126
commit
13fe994d0d
1 changed files with 4 additions and 4 deletions
|
@ -131,10 +131,6 @@ void SetAllowedFileTypes(NSSavePanel* dialog, const Filters& filters) {
|
||||||
[file_types_list addObject:content_types_set];
|
[file_types_list addObject:content_types_set];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't add file format picker.
|
|
||||||
if ([file_types_list count] <= 1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
NSArray* content_types = [file_types_list objectAtIndex:0];
|
NSArray* content_types = [file_types_list objectAtIndex:0];
|
||||||
|
|
||||||
__block BOOL allowAllFiles = NO;
|
__block BOOL allowAllFiles = NO;
|
||||||
|
@ -148,6 +144,10 @@ void SetAllowedFileTypes(NSSavePanel* dialog, const Filters& filters) {
|
||||||
|
|
||||||
[dialog setAllowedContentTypes:allowAllFiles ? @[] : content_types];
|
[dialog setAllowedContentTypes:allowAllFiles ? @[] : content_types];
|
||||||
|
|
||||||
|
// Don't add file format picker.
|
||||||
|
if ([file_types_list count] <= 1)
|
||||||
|
return;
|
||||||
|
|
||||||
// Add file format picker.
|
// Add file format picker.
|
||||||
ElectronAccessoryView* accessoryView = [[ElectronAccessoryView alloc]
|
ElectronAccessoryView* accessoryView = [[ElectronAccessoryView alloc]
|
||||||
initWithFrame:NSMakeRect(0.0, 0.0, 200, 32.0)];
|
initWithFrame:NSMakeRect(0.0, 0.0, 200, 32.0)];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue