nextcloud / desktop

đź’» Desktop sync client for Nextcloud
https://nextcloud.com/install/#install-clients
GNU General Public License v2.0
2.91k stars 774 forks source link

Use XDG Icon Themes To Facilitate Platform-Native Theming #3188

Open elsiehupp opened 3 years ago

elsiehupp commented 3 years ago

How to use GitHub

Expected behaviour

Nextcloud’s client applications should use platform-native UI icons where possible.

Actual behaviour

Nextcloud’s client applications use custom UI icons that look equally out-of-place everywhere.

Client configuration

Client version: 3.x (applies to a wide range of versions, though) Operating system: All OS language: All

Commentary

I originally posted this as a comment on https://github.com/nextcloud/desktop/issues/2915, but it’s separate enough that it makes sense to repost it as its own Issue, as well.

I’ve been meaning to weigh in on the issues of UI icons (not so much the application icon). If Nextcloud Desktop were to use the Freedesktop.org Icon Theme Specification (which Qt natively supports) and the Freedesktop.org Standard Icon Names, it would facilitate platform-specific UX theming and help the application feel more native.

Linux aside, Microsoft has both Fluent System Icons and Segoe Icons, while Apple has SF Symbols. Microsoft’s Fluent Icons are under the MIT License, so if I understand correctly they could be redistributed as part of the Nextcloud client code, but Segoe and SF Symbols would be linked through the operating systems’ APIs due to licensing. In both cases, a translation layer exposing the native icon themes as XDG icon themes would make sense to have as a separately distributable library for the benefit of other application developers, though to be honest that undertaking seems more like something Qt itself should pursue.

On Linux, the main XDG icon themes to target would probably be Adwaita and Breeze. I don’t know to what extent Adwaita and Breeze use compatible icon names beyond the base specification, though. One nice thing with the XDG icon specification as implemented in both GTK and Qt is that it can specify fallbacks, such that if an icon doesn’t exist in the primary theme a different icon can be used. In this way, Nextcloud Desktop could, for example, include variations of Adwaita and/or Breeze within the distributable so that themable UI icons would have reasonable defaults.

Probably the safest way to start with theming would be to remap the existing icon names onto the Freedesktop.org Icon Naming Specification and port the existing icon theme to the Freedektop.org Icon Theme Specification. Once this is done, Nextcloud Desktop could start adding whitelisted platform-specific icon themes that can be thoroughly tested. Ultimately allowing arbitrary icon themes seems like it should be a configurable option for the Linux version, but it should be disabled by default.

If any major Linux distributions that don’t use Adwaita or Breeze by default want Nextcloud to natively support their icon theme, it would be relatively easy for the distribution’s maintainers to make sure that their theme includes all of the necessary icons and then add the theme to Nextcloud’s whitelist.

Next Steps (Because GitHub Likes Checklists)

Port the existing theme to Qt’s XDG icon-theme interface

Add Native Themes

elsiehupp commented 3 years ago

Look, a progress indicator!

github issue progress indicator
elsiehupp commented 3 years ago

I should also mention that using XDG icon themes would facilitate further OEM interface theming, should that be desired.