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:
parent
a9343c9364
commit
3f2486342b
6 changed files with 66 additions and 38 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue