aseprite / laf

A C++ library to create desktop applications
https://aseprite.github.io/laf/
MIT License
282 stars 61 forks source link

Keep supplied extension in macOS save dialogues #9

Closed ayuusweetfish closed 5 years ago

ayuusweetfish commented 5 years ago

The dialogue should keep the extension if it's among the allowed ones, or append the first one in the allowed list to the file name otherwise. Closes aseprite/aseprite#1835.

For some reason setAllowedFileTypes: overwrites the extension provided in setNameFieldStringValue:, so it needs to be done before the latter. Apparently authors of electron have run into the same issue... Does this count as an upstream bug in AppKit? (=~=)

dacap commented 5 years ago

Hi @kawa-yoiko, I've tested this change on macOS 10.14.5 and the file extension is still not showing up 😢 Anyway after applying an extra change (c1a4379bf215caeb934f299bd684c8f2c0680e3c) it does work, so I've merged this change 👍