Page MenuHome

UI: File Browser Volumes and System Lists Icons
AcceptedPublic

Authored by Harley Acheson (harley) on Sep 15 2019, 5:12 PM.

Details

Summary

The File Browser has some list on the left side showing system volumes and other shortcuts. Although those items have icons, there is a limitation in that you can only have one icon PER LIST. Every item in each list has the same icon.

This patch makes it so that each item in the "System" and "Volumes" lists can be added with unique icons. Therefore volumes can have different icons per drive type. And each System icon can be different, if desired, to better differentiate them. Like having a special icon for "Desktop" or "My Documents", etc.

Note that the above is a capture from my Windows machine after applying this patch. It does not show changes to Volumes icons because we don't have those new icons properly added to the project. They will be added soon:

Diff Detail

Repository
rB Blender

Event Timeline

William Reynish (billreynish) requested changes to this revision.Sep 15 2019, 6:58 PM

The spirit of the patch is good, but in testing I couldn't get it to do what you claim it does:

This revision now requires changes to proceed.Sep 15 2019, 6:58 PM

Interesting. Did you rebuild target? There is a change to a python file included here.

Updated patch to use new "desktop", "removable drive", and "network drive" icons.

Note that this patch adds the ABILITY to use unique icons in the Volume and System lists, where we now they all have to be the same. And adds this ability for all platforms.

But this patch then uses that ability to display nicer icons when it can for Windows users, since drive list interrogation is platform-specific. Other platforms can do so as well. They just need to specify a desired icon as they add each entry item with fsmenu_insert_entry().

How it looks, on my Windows system, after this patch is applied:

@ThinkingPolygons (ThinkingPolygons) - The "recents" section is still there?

It sure is. I just make my interface scale large so it is scrolled below in that capture.

William Reynish (billreynish) resigned from this revision.EditedSep 15 2019, 10:08 PM

@Harley Acheson (harley) Ok, it was not clear to me that this was initially Windows-specific. I am fine with supporting Windows directories first and adding more later. But I'm then not able to review this. Adding @LazyDodo (LazyDodo) and @Julian Eisel (Severin) instead to test on Windows.

The spirit of the patch I have no issue with, but it's better if someone actually on Windows can test.

Linux "Desktop" System item can use ICON_DESKTOP

updating for current state of master

Updated for current state of master.

Replacing icon used for Fonts directory with ICON_FONTPREVIEW.

Wouldn't it be easier to scan with the eyes if the drive letter comes first, then the name?

@Julian Eisel (Severin) - Wouldn't it be easier to scan with the eyes if the drive letter comes first, then the name?

The names in the drive list? Possibly. What we see in that capture matches exactly what we see in Windows. It used to be that we took any label and appended the " (X:)" to it, but now that text is coming directly from a Windows API call.

It is probably because the drive letters are a bit secondary, while the device is longer-lived. Some device that is now mapped to "H" could be mapped to something different later.

Wouldn't it be easier to scan with the eyes if the drive letter comes first, then the name?

I agree, drive letters first would be easier to read.

It is probably because the drive letters are a bit secondary, while the device is longer-lived. Some device that is now mapped to "H" could be mapped to something different later.

Then again you probably save most often to "fixed volumes" like local drives, or network mapped locations, that are generally attributed the same drive on boot.
Also drive letters are usually the same character length, something along the lines of (D:) while volume labels can vary, which creates a nice visual alignment that is easy to follow like

(C:) Windows
(D:) Local Disk
(E:) Blu Ray
(F:) Home
(G:) Backup

as opposed to the more visually disconnected

Windows (C:)
Local Disk (D:)
Blu Ray (E:)
Home (F:)
Backup (G:)

@Duarte Farrajota Ramos (duarteframos) - I agree, drive letters first would be easier to read.

We could swap that around, but...

That entire string - in that particular order and including the drive letter - is provided by the operating system as the definitive display name for each volume. It isn't something I've put together. It should match exactly what you see in the operating system when it shows you your list of drives.

Platform wise, not a huge fan of sprinkling #ifdef win32's all over the place, but there currently is no place to segregate platform specific stuff like this, so what you have now will do just fine for now.

Took a quick peek, UI wise it would be nice if CD/DVD drives have their own icon, they now show up as an external drive which people will probably nitpick over.

I have to agree with @Harley Acheson (harley) here that it be best to follow windows explorer here and stick to the Description (Letter:) formatting.

From a technical perspective i have nothing to hold up this diff up and i'll leave it up to the UI guys to have the final say here.

This revision is now accepted and ready to land.Sun, Oct 6, 7:59 PM

Thanks @LazyDodo (LazyDodo)!

Although, for the record, should say that Julien’s (and others) comments on the drive description string are off topic as this patch doesn’t change that at all, only the icons shown beside the text. The change to volume labels - for Windows only - was done in an earlier patch committed quite a while ago.

@LazyDodo (LazyDodo) - it would be nice if CD/DVD drives have their own icon, they now show up as an external drive which people will probably nitpick over.

I'm torn on this one. It would be pretty easy for jendrych to add a little CD/DVD icon. But then we'd also need a large version of it too. Although we are not currently using them we have large "volume" icons to go along with the large document and folder icons we see when in thumbnail view. The idea is to (eventually) have a "computer root" display.

@Harley Acheson (harley) If we need a root view, we'll need a large disk icon probably anyway. We could add this, and add support for it after the icon is added.

@William Reynish (billreynish) - yes, you are right. And is all a bit outside of this patch anyway. In the end this patch doesn't really do much more than add the ability to have distinct icons for each item in the "Volumes" and "System" lists. What items are on those lists and what icons are shown can easily be added, corrected, changed, later.