Wavesonics / compose-multiplatform-file-picker

A multiplatform compose widget for picking files
MIT License
346 stars 21 forks source link

Customize which file picker to use on Windows #83

Open StefanOltmann opened 1 year ago

StefanOltmann commented 1 year ago

Can we configure which file picker to use on Windows?

We now have the smaller variant, but there is also a bigger one including a sidebar. I would prefer to use that one.

shalva97 commented 1 year ago

Which version do you use? most likely you are seeing custom file picker done in Java

The functionality to choose a file was done in a same way as https://github.com/jakobkmar/pacmc did. Pacmc tried to call native file chooser and if there is an error then it falls back to Swing file chooser.

In version 3.0.0 I have removed it, https://github.com/Wavesonics/compose-multiplatform-file-picker/pull/67. Also I saw your comments on an issue about publishing and Im guessing you are using 3.0.0, if that's the case then it is very strange, we call TinyFileDialogs here: https://github.com/Wavesonics/compose-multiplatform-file-picker/blob/25cd665de1fe60c97d5890592b69a2a376060b4c/mpfilepicker/src/jvmMain/kotlin/com/darkrockstudios/libraries/mpfilepicker/FileChooser.kt#L17

It should show a dialog like this image

StefanOltmann commented 1 year ago

That's strange. Using v3.0.0 now I got this file picker on Windows 11:

But I want it to look like the one you get on Windows 10.

The Swing File Chooser looks more like the original one, but I'm glad to get rid of all that code for it thanks to this library.

shalva97 commented 11 months ago

I don't know, why there is no one Java file picker library that works.

Anyways. The only solution here seems to be to use use NativeFileDialog only on Windows and TinyFileDialogs on other platforms.

While testing I can confirm that NativeFileDialog shows correct dialog

image

StefanOltmann commented 11 months ago

@shalva97 Thank you for figuring this out. Unfortunately this doesn't help me with my Windows JVM app right now.

shalva97 commented 11 months ago

Well, there is work to be done, maybe people reading this issue will get an idea of how to fix this.

I can't promise I will fix it in nearest future...

StefanOltmann commented 11 months ago

@shalva97 Yeah, lets hope for that. Using the smaller picker is no show stopper for me. The bigger picker would just be nice to have.

vareille commented 9 months ago

@StefanOltmann what you are showing here is a directory picker and not the file picker.

StefanOltmann commented 5 months ago

@vareille Thank you for the hint.

Okay, in that case I'm asking for having the file picker, but let it only select directories. That is the more "usual" view I often see and the picker I'm asking for. shalva97 also has this picker in his screenshot.

grafik