diff --git a/src/components/window/file.rs b/src/components/window/file.rs index 3a51ce0..c6a306d 100644 --- a/src/components/window/file.rs +++ b/src/components/window/file.rs @@ -8,7 +8,7 @@ use crate::components::editor::EchidnaCoreEditor; use gio::Cancellable; use glib::{clone, Priority}; use gtk::{ - prelude::*, subclass::prelude::*, FileChooserAction, FileChooserDialog, Label, ResponseType, + prelude::*, subclass::prelude::*, FileChooserAction, FileChooserNative, Label, ResponseType, }; use sourceview::{prelude::*, Buffer, File, FileSaver}; @@ -36,14 +36,12 @@ impl FileImplementedEditor for super::EchidnaWindow { Perhaps some of the last points should not be implemented in this function but rather in another function that keeps track of every files. */ fn action_open_file(&self) { - let dialog: FileChooserDialog = FileChooserDialog::new( + let dialog = FileChooserNative::new( Some("Open a file"), Some(self), FileChooserAction::Open, - &[ - ("Cancel", ResponseType::Cancel), - ("Open", ResponseType::Accept), - ], + Some("Open"), + Some("Cancel"), ); dialog.set_visible(true); @@ -81,14 +79,12 @@ impl FileImplementedEditor for super::EchidnaWindow { } fn action_save_file_as(&self) { - let dialog = FileChooserDialog::new( + let dialog = FileChooserNative::new( Some("Save File As"), Some(self), FileChooserAction::Save, - &[ - ("Cancel", ResponseType::Cancel), - ("Save", ResponseType::Accept), - ], + Some("Open"), + Some("Cancel"), ); dialog.set_current_name("untitled"); diff --git a/src/components/window/workspace.rs b/src/components/window/workspace.rs index 9cc5c6c..7a2321a 100644 --- a/src/components/window/workspace.rs +++ b/src/components/window/workspace.rs @@ -9,7 +9,7 @@ use glib::clone; use glib::subclass::types::ObjectSubclassExt; use glib::types::Type; use gtk::prelude::*; -use gtk::{ApplicationWindow, FileChooserAction, FileChooserDialog, ResponseType, TreeStore}; +use gtk::{ApplicationWindow, FileChooserAction, FileChooserNative, ResponseType, TreeStore}; use relative_path::RelativePath; use serde::{Deserialize, Serialize}; use std::path::Path; @@ -46,14 +46,12 @@ impl WorkspaceImplementedEditor for EchidnaEditor { _action: &SimpleAction, _variant: Option<&glib::Variant>, ) { - let dialog: FileChooserDialog = FileChooserDialog::new( + let dialog = FileChooserNative::new( Some("Open a file"), Some(&window), FileChooserAction::Open, - &[ - ("Cancel", ResponseType::Cancel), - ("Open", ResponseType::Accept), - ], + Some("Open"), + Some("Cancel"), ); dialog.set_visible(true); dialog.connect_response(clone!(@weak window, @weak app => @@ -78,7 +76,7 @@ impl WorkspaceImplementedEditor for EchidnaEditor { * * Basically, this is just the same as Open Folder, but it's many folders. * - * - Open a FileChooserDialog, set to only view .code-workspace files. + * - Open a FileChooserNative, set to only view .code-workspace files. * - If the user pressed cancel, destroy the dialog. If the user opened a .code-workspace file: * - Get the workspace file, load and parse its content, .code-workspace files are in JSON with comments. But JSON only should be fine, for now. * - Iterate over folders listed in the workspace file.