Skip to content
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

Distinguish Folder Icon From Application Icon #2903

Closed
pkrolkgp opened this issue Feb 4, 2021 · 17 comments
Closed

Distinguish Folder Icon From Application Icon #2903

pkrolkgp opened this issue Feb 4, 2021 · 17 comments
Assignees
Labels
enhancement enhancement of a already implemented feature/code

Comments

@pkrolkgp
Copy link

pkrolkgp commented Feb 4, 2021

I would like enchancement that distinguish betwen app and nextcloud folder, because right now they look the same.

Expected behaviour

User should know what is gonna open

Actual behaviour

You cant tell if u open app or folder
obraz
obraz

Steps to reproduce

  1. open start menu on windows and add to metro menu nextcloud folder and nextcloud app

Client configuration

Client version: 3.1.2

Operating system:
Windows

OS language:
Irrelevant

Installation path of client:
Standard

@er-vin er-vin added design enhancement enhancement of a already implemented feature/code labels Feb 4, 2021
@er-vin
Copy link
Member

er-vin commented Feb 4, 2021

@jancborchardt what do you think?

@elsiehupp
Copy link
Member

I was actually giving some thought to folder icons just now, and it does seem like it would be reasonable for them to both be themed and be distinct from the application icon. I'm not familiar with Windows 10 icon-design norms, though.

@elsiehupp
Copy link
Member

FWIW it could also be nice for Nextcloud to use a full-bleed Start Tile icon, if those are still a thing.

@elsiehupp
Copy link
Member

I decided to do some quick folder-icon mockups for a Nextcloud folder on Windows 10. I was able to extract two different folder icons from a Windows DLL, and all I did was recolor them and on one of them add a Nextcloud logo. Because of copyright and whatnot, it might be preferable to do a custom SVG icon set based on more or less the same outline, with the added benefit of easier theming. (The only common image format that supports "recolor" layers is PSD, which isn't FOSS and isn't particularly easy to manipulate programmatically.) Anyway, here are the extremely preliminary mockups:
flat-256x256open-256x256
One disadvantage of using a recolor layer (versus drawing the entire thing in vector) is that it's harder to match the exact color tones of the existing application icon. i.e. these icons are a bit high on luminosity compared to the Nextcloud app icon, because they derive their luminosity from the folder icon. If there's interest I could go ahead and do an SVG of one or both of these.

Again, another advantage with SVG is that it would be somewhat easier to programmatically theme the icon based on an OEM's brand colors and/or symbolic logo. Linux Mint has a Python script for rasterizing SVG icons, and I imagine it wouldn't be too difficult to adapt to spit out Windows ICO files instead. I imagine the color fill and possibly even the logo could be added using an additional script, though that's a bit beyond the scope at the moment.

One other thing worth mentioning is that it's common for smaller sizes of icons to use simpler glyphs. So the smaller sizes of the Nextcloud folder icon might just be the Nextcloud logo itself, rather than a folder or even a circle. See, for comparison, the OneDrive sidebar icon that is enabled by default in Windows Explorer (in contrast to the "Music" icon above it, which for whatever reason still features the folder symbol):

onedrive-sidebar

@elsiehupp
Copy link
Member

As for Start Menu Tile icons, it looks like they're part of the VisualElementsManifest:

https://docs.microsoft.com/en-us/windows/uwp/design/style/app-icons-and-logos

@elsiehupp
Copy link
Member

I did some further digging, and this StackOverflow answer explains how to set a folder icon programmatically in Windows.

The only related class in Qt appears to be QFileIconProvider, but it only seems to apply to icons within the application, not icons as they appear in the operating system's file browser.

@elsiehupp
Copy link
Member

It looks like the code that sets the folder icon is here:

// First create a Desktop.ini so that the folder and favorite link show our application's icon.
QFile desktopIni(folder + QLatin1String("/Desktop.ini"));
if (desktopIni.exists()) {
qCWarning(lcUtility) << desktopIni.fileName() << "already exists, not overwriting it to set the folder icon.";
} else {
qCInfo(lcUtility) << "Creating" << desktopIni.fileName() << "to set a folder icon in Explorer.";
desktopIni.open(QFile::WriteOnly);
desktopIni.write("[.ShellClassInfo]\r\nIconResource=");
desktopIni.write(QDir::toNativeSeparators(qApp->applicationFilePath()).toUtf8());
desktopIni.write(",0\r\n");
desktopIni.close();

@elsiehupp
Copy link
Member

It seems like the easiest way to use a folder icon would be to add it as the second icon in the .exe and then change line 50 to the following:

desktopIni.write(",1\r\n");

The second icon would have to be added somewhere in AddAppIconMacro.cmake. I can dig further.

@jancborchardt
Copy link
Member

@elsiehupp how do others like Dropbox and Google Drive solve this issue on Windows, which kind of separate icons do they have?

@er-vin
Copy link
Member

er-vin commented Mar 10, 2021

It seems like the easiest way to use a folder icon would be to add it as the second icon in the .exe and then change line 50 to the following:

desktopIni.write(",1\r\n");

Yes, looks like you're on the right track there.

The second icon would have to be added somewhere in AddAppIconMacro.cmake. I can dig further.

Yep, I think this macro is a bit moody though. Be careful, here lie dragons. ;-)

@elsiehupp elsiehupp changed the title Distinguish betwen desktop icons Distinguish Folder Icon From Application Icon Mar 10, 2021
@elsiehupp elsiehupp self-assigned this Mar 10, 2021
@elsiehupp
Copy link
Member

I had been working on a Nextcloud folder-icon set based on the Windows 10 folder icons, but then Microsoft up and released a major update to the Windows 10 icon theme:

Old and New Windows 10 Pictures Folder Icons

I have not been able to get Windows installed on my computer—the Windows installer doesn’t like my partitioning scheme—so I don’t have an easy way of accessing the DLLs containing the new icons for the purpose of extracting them.

If any of you have a working copy of Windows with the new icons installed, could you try and get me a copy of the new %systemroot%\system32\shell32.dll? Or maybe figure out if the icons are located somewhere else? Thanks!

@pkrolkgp
Copy link
Author

pkrolkgp commented May 2, 2021

I suggest You to get official microsoft VM's.
Download

@elsiehupp
Copy link
Member

For a variety of reasons I would prefer to get an actual normal Windows 10 install up and running. I did get a Windows 10 VM running previously, but among other things it didn’t automatically activate with my hardware profile. (My main Linux PC shipped with Windows preinstalled, so I have an OEM license with no printed key.)

@elsiehupp
Copy link
Member

Hi @jancborchardt—Sorry for the lack of explanation! I closed this PR partially because of the lack of activity, yes, but also because Microsoft no longer uses Start Menu Tiles in Windows 11.

There’s a new feature in Windows 11 called “widgets” which seem similar to Live Tiles, but it’s not clear how to create them. It could be nice to have a Nextcloud widget and a Nextcloud Live Tile that are roughly equivalent to each other, but that would probably be a lot of work, and it would have to wait on Microsoft releasing a widget development guide.

If you want to use a full-bleed Start Tile in Windows 10 regardless, it would be worth testing to make sure still Windows 11 correctly uses a standard icon in the new Start Menu. I don’t currently have a working install of Windows 10 or Windows 11, so I can’t test this myself.

Originally posted by @elsiehupp in #2982 (comment)

Since the Pull Request with the above comment got merged, I figured here might be a better place to mention that Microsoft recently announced the upcoming availability of a third-party API for Windows 11 Widgets. This API will be based on Microsoft's cross-platform Adaptive Cards platform, so it might actually be worth engaging with at some point.

Yes, Windows 11 widgets are a bit off-topic for this particular thread, but I didn't feel like creating an entirely new Issue just to follow up. (It also sounds like the "Adaptive Cards" platform might be more relevant to Nextcloud Server than Nextcloud Desktop, though any Nextcloud Adaptive Card would presumably also have platform-specific local/offline extensions.)

@elsiehupp
Copy link
Member

Anyway, if anyone here does have an installed copy of Windows 11 that they can use to get copies of the DLLs containing the new icon set, feel free to send me the DLLs so I can extract the folder icons to use them as design templates. (I could also probably download the DLLs from some sketchy website like I ended up doing with the Windows 10 ones, but I haven't really looked into it since Windows 11 was widely released.)

@elsiehupp
Copy link
Member

I just found a set of extracted icons from Windows 11, so that should be a good starting place for this!

@Rello
Copy link
Contributor

Rello commented Nov 25, 2024

Hello,

thank you for opening the request.
The client has improved a lot since the ticket was opened.
Can you support us and check if it is still relevant? In this case we appreciate a new ticket or a comment here.
Thank you for your support

@Rello Rello closed this as completed Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement enhancement of a already implemented feature/code
Projects
None yet
Development

No branches or pull requests

5 participants