diff options
author | Ac_K <Acoustik666@gmail.com> | 2021-09-14 23:52:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-14 23:52:08 +0200 |
commit | 3f2486342b3ef4610b6af6a52624614d2a7ad8ae (patch) | |
tree | 3fe29d9f11f6556c4af62fda59c282707bf5bbbc /Ryujinx/Ui/Windows/UserProfilesManagerWindow.cs | |
parent | a9343c9364246d3288b4e7f20919ca1ad2e1fd3e (diff) |
gui: Replace FileChooserDialog by FileChooserNative (#2633)
We currently use the FileChooser from GTK, which is a bit mess. Instead of it we could use the native FileChooser from all specifics OS. This is what this PR attempt to fix.
It could be nice to get a test under linux since I've only tested it under Windows without any issues.
Fixes #2584
Diffstat (limited to 'Ryujinx/Ui/Windows/UserProfilesManagerWindow.cs')
-rw-r--r-- | Ryujinx/Ui/Windows/UserProfilesManagerWindow.cs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/Ryujinx/Ui/Windows/UserProfilesManagerWindow.cs b/Ryujinx/Ui/Windows/UserProfilesManagerWindow.cs index 6a4788b1..b26e7e20 100644 --- a/Ryujinx/Ui/Windows/UserProfilesManagerWindow.cs +++ b/Ryujinx/Ui/Windows/UserProfilesManagerWindow.cs @@ -193,17 +193,21 @@ namespace Ryujinx.Ui.Windows private void ProfileImageFileChooser() { - FileChooserDialog fileChooser = new FileChooserDialog("Import Custom Profile Image", this, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Import", ResponseType.Accept) + FileChooserNative fileChooser = new FileChooserNative("Import Custom Profile Image", this, FileChooserAction.Open, "Import", "Cancel") { - SelectMultiple = false, - Filter = new FileFilter() + SelectMultiple = false }; - fileChooser.SetPosition(WindowPosition.Center); - fileChooser.Filter.AddPattern("*.jpg"); - fileChooser.Filter.AddPattern("*.jpeg"); - fileChooser.Filter.AddPattern("*.png"); - fileChooser.Filter.AddPattern("*.bmp"); + FileFilter filter = new FileFilter() + { + Name = "Custom Profile Images" + }; + filter.AddPattern("*.jpg"); + filter.AddPattern("*.jpeg"); + filter.AddPattern("*.png"); + filter.AddPattern("*.bmp"); + + fileChooser.AddFilter(filter); if (fileChooser.Run() == (int)ResponseType.Accept) { |