Bug 1109378

Summary: Deprecate share/YaST2/theme/current/icons symlink with Qt's (and DE's) native icon theme switching methods
Product: [openSUSE] openSUSE Tumbleweed Reporter: Sasi Olin <hel>
Component: YaST2Assignee: YaST Team <yast-internal>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P3 - Medium CC: hel, itaranto7, lnussel, locilka
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
URL: https://trello.com/c/SXpyKytM/2589-tw
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 1081517    

Description Sasi Olin 2018-09-22 14:21:09 UTC
Support is mostly in place, modules that use native method from libyui-qt and qt-pkg will have support for that (exception being those that use different methods in ruby code, which some of them do). Exceptions that are related to images specific to YaST, that shouldn't be changed with icon theme, should be moved to pixmaps directory instead (example being yast-aardwark).
Comment 1 Arvin Schnell 2018-09-24 07:30:49 UTC
Looks like a feature request to me.

Reassigning as explained in the "tasks of the yast2-maintainer-assigned person".
Comment 2 Lukas Ocilka 2018-09-26 14:09:26 UTC
Stasiek, your request is not 100% clear to me.

Clould you, please, explain, what exactly you want, according to which
specification or related bug, feature, anything?

You can give examples, point to the code, etc.
But it's not clear what exactly you want to achieve, please, help us to get
that info first before playing with assignee and bug severity.

Thanks in advance.
Comment 3 Sasi Olin 2018-09-26 14:37:15 UTC
Qt provides QIcon:fromTheme function,
https://doc.qt.io/archives/qt-5.10/qicon.html#fromTheme
which allows individual icons to be used from the currently set system theme (by DE/WM/Qt), which is a much better scheme than using symlinks to /usr/share/icons/*theme*, because in cases like Breeze icon scheme, which has standard icon theme schema, but isn't the same as schema in hicolor (breeze/apps/32/ vs hicolor/32x32/apps/), it breaks even with set symlink. There are a plethora of examples, in basically every module: 

https://github.com/yast/yast-rake/blob/master/lib/tasks/install.rake#L29
https://github.com/yast/yast-yast2/blob/master/library/general/src/modules/Directory.rb#L91
https://github.com/yast/yast-storage-ng/blob/master/src/lib/y2partitioner/icons.rb

Using the native Qt method, in this case, would allow for much better compatibility with icon themes, which is not possible considering that ruby code refers to the full icon locations.

YaST Control Center and parts of YaST Package Manager already have patches that fixed those issues, and icons load properly. In case of KDE that requires root to have icon theme selected, which is not done by default as of now but is possible to be set in the future, it works natively with Gnome icon theme selection, would also be fixed if authentication used was through polkit, as YaST as a whole wouldn't run as root (that would also fix some other theming related issues of YaST).

theme/current/icons is just in a way of getting YaST to be fully customizable, even though it was created in an effort to make YaST customizable, oh the irony :D
Comment 4 Lukas Ocilka 2018-10-01 07:42:38 UTC
Ludwig, do you have more for this topic, PLS? I guess you could.

It's hard to tell if it's feature request or bug report. In fact it's both.
It works "as designed", so change is a feature request, but it was not
designed well to systems of "today", so it's a bug. Anyway, does not matter.
Comment 5 Ludwig Nussel 2018-10-01 08:30:38 UTC
/usr/share/YaST2/theme/current was retired in bug 1104067, so fixing the hardcoded locations Stasiek pointed out is just natural.
Comment 6 Sasi Olin 2018-11-08 23:46:17 UTC
*** Bug 1053325 has been marked as a duplicate of this bug. ***
Comment 7 Stefan Hundhammer 2018-11-14 16:12:39 UTC
Stasiek spent a lot of very dedicated work to fix the C++ part of this in libyui-qt:

    https://github.com/libyui/libyui-qt/pull/93

So the Qt UI now provides the infrastructure to use theme icons. This will be available with libyui-qt-2.49.8 or later.

What's left now is all the paths for those icons in the Ruby part.
Comment 8 Sasi Olin 2018-11-30 18:05:06 UTC
Deprecated, no module loads data from that dir anymore.