macos: support drag-and-drop and default file associations (#1822)

* macos: support drag-and-drop and default file associations

* resources/macos: use LSItemContentTypes to narrow down files

* macos: support opening folders

* rootview: workaround macos weird dnd event timing

* core/rootview: rename variable and refactor if statement
This commit is contained in:
Takase
2024-06-23 10:08:08 +08:00
committed by takase1121
parent 214602d17a
commit ce70fcf5dd
3 changed files with 51 additions and 17 deletions
+26 -2
View File
@@ -8,8 +8,32 @@
<string>lite-xl</string>
<key>CFBundleIconFile</key>
<string>icon.icns</string>
<key>CFBundleIdentifier</key>
<string>com.lite-xl</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>*</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>NSDocumentClass</key>
<string>NSDocument</string>
<key>CFBundleTypeName</key>
<string>All Files</string>
</dict>
</array>
<key>LSItemContentTypes</key>
<array>
<string>public.text</string>
<string>public.folder</string>
</array>
<key>NSExportableTypes</key>
<array>
<string>public.text</string>
</array>
<key>CFBundleIdentifier</key>
<string>com.lite-xl</string>
<key>CFBundleName</key>
<string>Lite XL</string>
<key>CFBundlePackageType</key>