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
This commit is contained in:
Ac_K 2021-09-14 23:52:08 +02:00 committed by GitHub
parent a9343c9364
commit 3f2486342b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 66 additions and 38 deletions

View file

@ -563,7 +563,7 @@ namespace Ryujinx.Ui.Windows
}
else
{
FileChooserDialog fileChooser = new FileChooserDialog("Choose the game directory to add to the list", this, FileChooserAction.SelectFolder, "Cancel", ResponseType.Cancel, "Add", ResponseType.Accept)
FileChooserNative fileChooser = new FileChooserNative("Choose the game directory to add to the list", this, FileChooserAction.SelectFolder, "Add", "Cancel")
{
SelectMultiple = true
};
@ -622,10 +622,15 @@ namespace Ryujinx.Ui.Windows
private void BrowseThemeDir_Pressed(object sender, EventArgs args)
{
using (FileChooserDialog fileChooser = new FileChooserDialog("Choose the theme to load", this, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Select", ResponseType.Accept))
using (FileChooserNative fileChooser = new FileChooserNative("Choose the theme to load", this, FileChooserAction.Open, "Select", "Cancel"))
{
fileChooser.Filter = new FileFilter();
fileChooser.Filter.AddPattern("*.css");
FileFilter filter = new FileFilter()
{
Name = "Theme Files"
};
filter.AddPattern("*.css");
fileChooser.AddFilter(filter);
if (fileChooser.Run() == (int)ResponseType.Accept)
{