-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve UX of drive letters #36069
Improve UX of drive letters #36069
Conversation
Why is the "Path:" label all the way to the left in the GNU/Linux screenshot? |
Since I did this on an earlier version of Godot, I think this is a rebasing error. But now I think of it, it may be better to remove the label altogether. |
32b5f99
to
9566d7c
Compare
Fixed (and screenshot updated). Whether to remove labels that add little or no value, like Path or Files & Directories could be studied engine-wide, as a separate concern. |
9566d7c
to
02e583f
Compare
02e583f
to
603be7b
Compare
UX-wise it looks good to me. I kind of dislike the fact we have to implement a specific set of functions (like |
Yes, I thought about it, but in the end I considered that was the less ugly solution, at least from those I could come up with. |
core/bind/core_bind.cpp
Outdated
@@ -2367,6 +2367,11 @@ String _Directory::get_current_dir() { | |||
ERR_FAIL_COND_V_MSG(!d, "", "Directory must be opened before use."); | |||
return d->get_current_dir(); | |||
} | |||
String _Directory::get_current_dir_without_drive() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could simply add an "include_drive" as an optional argument to get_current_dir(). Those two functions do the same thing in general, so that might be cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That has a point, but I still prefer a separate method. Boolean parameters are hard to read in the calling location.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kind of disagree, since most of the time the parameter is not there it does not make a significant difference IMHO. It's better than adding functions with longs name for each possible case.
But well, it's not that important. If others have an opinion on that that would be nice :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also prefer optional arguments to multiple functions. I had this discussion earlier in the context of the C# string code. Should be get_current_dir(bool include_drive = true)
(or false)
P.S. This needs empty lines as per #33027 "Enforce one line between function implementations"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change done.
Regarding empty lines, such a cosmetic change is something to be done aside of this PR, especially after the requested changes, since now it's not even adding/removing methods at all.
With the dropdown on the right on Linux, perhaps there should also be a |
In that case you probably can just use the go to parent button all the way up. Or, since you are a power user, able to add mount points that way, you'd probably just type the path without even using the dialog at all. 😆 More seriously now, that's out of the scope of this PR. |
603be7b
to
e302629
Compare
e302629
to
628550d
Compare
Initially this seemed like a good idea but it makes copy-pasting paths much more annoying on windows. Currently it is possible to quickly interchange between Windows Explorer and the Godot File Browser, as shown below, but will not be possible with this PR, making godot the first PC software to not have this feature. |
You have a point there. I think I can do a couple of modifications to have the best of both worlds. |
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.
628550d
to
aee5865
Compare
Thanks! |
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.
Browsing the file system (Windows)
(Note the drive letters at the left of the directory and not being part of it.)
Browsing the file system (Linux)
(Note the "drives" at the right and being part of the path. The directory API now reports that drives are shortcuts for UNIX-derived platforms.)
This code is generously donated by IMVU.