diff options
author | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2020-02-10 09:19:29 +0100 |
---|---|---|
committer | Pedro J. Estébanez <pestebanez@imvu.com> | 2020-03-03 10:38:34 +0100 |
commit | aee586553a4be72b72b669fb489fae72337ab7ad (patch) | |
tree | ef448436ccff0922cb2dfbc6c589af6acd77cf41 /drivers/windows | |
parent | 3c7d92c590f48ea9a265ec20d7af43a3aa44632f (diff) | |
download | redot-engine-aee586553a4be72b72b669fb489fae72337ab7ad.tar.gz |
Improve UX of drive letters
Namely, move the drive dropdown to just the left of the path text box and don't include the former
in the latter.
This improves the UX on Windows.
In the UNIX case, since its concept of drives is (ab)used to provide shortcuts to useful paths, its
dropdown is kept at the original location.
Diffstat (limited to 'drivers/windows')
-rw-r--r-- | drivers/windows/dir_access_windows.cpp | 8 | ||||
-rw-r--r-- | drivers/windows/dir_access_windows.h | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp index 8e0eac6986..cf09f79832 100644 --- a/drivers/windows/dir_access_windows.cpp +++ b/drivers/windows/dir_access_windows.cpp @@ -189,7 +189,7 @@ Error DirAccessWindows::make_dir(String p_dir) { return ERR_CANT_CREATE; } -String DirAccessWindows::get_current_dir() { +String DirAccessWindows::get_current_dir(bool p_include_drive) { String base = _get_root_path(); if (base != "") { @@ -203,7 +203,11 @@ String DirAccessWindows::get_current_dir() { } else { } - return current_dir; + if (p_include_drive) { + return current_dir; + } else { + return current_dir.right(current_dir.find(":") + 1); + } } bool DirAccessWindows::file_exists(String p_file) { diff --git a/drivers/windows/dir_access_windows.h b/drivers/windows/dir_access_windows.h index 43951c0be9..f59e4d7030 100644 --- a/drivers/windows/dir_access_windows.h +++ b/drivers/windows/dir_access_windows.h @@ -69,7 +69,7 @@ public: virtual String get_drive(int p_drive); virtual Error change_dir(String p_dir); ///< can be relative or absolute, return false on success - virtual String get_current_dir(); ///< return current dir location + virtual String get_current_dir(bool p_include_drive = true); ///< return current dir location virtual bool file_exists(String p_file); virtual bool dir_exists(String p_dir); |