Bug 372966 - Some icons are not seen using a plain Ubuntu (not Kubuntu) 16.04
Summary: Some icons are not seen using a plain Ubuntu (not Kubuntu) 16.04
Status: RESOLVED FIXED
Alias: None
Product: krusader
Classification: Applications
Component: general (show other bugs)
Version: Git
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krusader Bugs Distribution List
URL:
Keywords:
: 376699 386554 391899 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-11-26 18:53 UTC by Toni Asensi Esteve
Modified: 2018-05-06 00:15 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Icons not seen using Ubuntu 16.04 (even when plasma-workspace and other packages are installed) (155.55 KB, image/png)
2016-11-26 18:53 UTC, Toni Asensi Esteve
Details
Some icons are not seen using Ubuntu 16.04 (even when plasma-workspace and other packages are installed) (150.92 KB, image/png)
2017-01-19 17:54 UTC, Toni Asensi Esteve
Details
Trying Kate: Using the same Ubuntu 16.04: the icons of another Qt5/KF5 program like Kate are correctly seen, instead of showing text descriptions. (35.70 KB, image/png)
2017-01-19 17:57 UTC, Toni Asensi Esteve
Details
Trying Konsole: Using the same Ubuntu 16.04, the icons of another Qt5/KF5 program like Konsole are correctly seen, instead of showing text descriptions. (39.02 KB, image/png)
2017-01-19 17:59 UTC, Toni Asensi Esteve
Details
As a consequence, in that Ubuntu 16.04 machine, Krusader icons are now OK. (151.42 KB, image/png)
2017-01-19 18:04 UTC, Toni Asensi Esteve
Details
How Kate icons look now, after the use of qt5ct. (36.48 KB, image/png)
2017-01-19 18:05 UTC, Toni Asensi Esteve
Details
How Konsole icons look now, after the use of qt5ct. (43.26 KB, image/png)
2017-01-19 18:06 UTC, Toni Asensi Esteve
Details
Krusader 2.5 settings on Ubuntu 16.04 (77.12 KB, image/png)
2017-02-02 11:04 UTC, Wladimir Palant
Details
Dolphin config page with Adwaita icon theme (40.62 KB, image/png)
2017-02-10 16:05 UTC, Alex Bikadorov
Details
Kate config page with Adwaita icon theme (47.14 KB, image/png)
2017-02-10 16:05 UTC, Alex Bikadorov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toni Asensi Esteve 2016-11-26 18:53:19 UTC
Created attachment 102456 [details]
Icons not seen using Ubuntu 16.04 (even when plasma-workspace and other packages are installed)

After installing Krusader in a plain Ubuntu (not Kubuntu) 16.04 some icons are not seen (even if the packages plasma-workspace, plasma-framework, etc. are installed). A screenshot is attached.

Those unseen icons are:
    Unselect All
    Select Group
    Compare by Content
    MountMan
    Profiles

-------------------- Additional information --------------------

Davide Gianforte wrote on a mail (wich had a 18-08-15 date and a subject "Re: [Krusader-devel] Breeze icons for krusader"):
      "ATM, krusader always try to load icons from the current theme (using QIcon::fromTheme(icon) defined in krusader/actionsbase:42 - ActionsBase::createAction), if there is no suitable icon, it uses the internal one (oxygen-based)."

I executed
    dpkg -l | grep breeze
and it showed
    ii  breeze-icon-theme                             4:5.18.0-0ubuntu1                             amd64        Default Plasma icon theme.
    ii  kde-style-breeze                              4:5.5.5-0ubuntu1                              amd64        Widget style for Qt and KDE Software
    ii  kde-style-breeze-qt4                          4:5.5.5-0ubuntu1                              amd64        Widget style for Qt 4 and KDE Software
    ii  libreoffice-style-breeze                      1:5.1.4-0ubuntu1                              all          office productivity suite -- Breeze symbol

I executed 
    dpkg -l | grep -i plasma
and it showed                
    ii  breeze-icon-theme                             4:5.18.0-0ubuntu1                             amd64        Default Plasma icon theme.
    ii  libkdeclarative5                              4:4.14.16-0ubuntu3                            amd64        declarative library for plasma
    ii  libkf5plasma5:amd64                           5.18.0-0ubuntu1.1                             amd64        Plasma Runtime components
    ii  libkf5plasmaquick5:amd64                      5.18.0-0ubuntu1.1                             amd64        Plasma Runtime components
    ii  libkworkspace5-5                              4:5.5.5.2-0ubuntu1                            amd64        Plasma Workspace for KF5 library
    ii  libplasma-geolocation-interface5              4:5.5.5.2-0ubuntu1                            amd64        Plasma Workspace for KF5 library
    ii  libplasma3                                    4:4.14.16-0ubuntu3                            amd64        Plasma Library for the KDE Platform
    ii  libtaskmanager5                               4:5.5.5.2-0ubuntu1                            amd64        Plasma Workspace for KF5 library
    ii  libweather-ion7                               4:5.5.5.2-0ubuntu1                            amd64        Plasma Workspace for KF5 library
    ii  plasma-framework                              5.18.0-0ubuntu1.1                             amd64        Plasma Runtime components
    ii  plasma-framework-dev                          5.18.0-0ubuntu1.1                             amd64        development files for plasma-framework
    ii  plasma-scriptengi            

I executed:
    find / -iname "*mountman.png*" 2>/dev/null
and it showed
    /usr/share/krusader/icons/hicolor/32x32/actions/kr_mountman.png
    /usr/share/krusader/icons/hicolor/16x16/actions/kr_mountman.png
    /usr/share/krusader/icons/hicolor/22x22/actions/kr_mountman.png
    /usr/share/doc/HTML/en/krusader/mountman.png
    /home/user/krusader/pics/32-actions-kr_mountman.png
    /home/user/krusader/pics/22-actions-kr_mountman.png
    /home/user/krusader/pics/16-actions-kr_mountman.png
    /home/user/krusader/doc/mountman.png
Comment 1 Toni Asensi Esteve 2017-01-19 17:54:25 UTC
Created attachment 103538 [details]
Some icons are not seen using Ubuntu 16.04 (even when plasma-workspace and other packages are installed)

The screenshot of Krusader (under Ubuntu 16.04) was updated, now it shows the latest git version of Krusader.
Comment 2 Toni Asensi Esteve 2017-01-19 17:57:52 UTC
Created attachment 103539 [details]
Trying Kate: Using the same Ubuntu 16.04: the icons of another Qt5/KF5 program like Kate are correctly seen, instead of showing text descriptions.
Comment 3 Toni Asensi Esteve 2017-01-19 17:59:14 UTC
Created attachment 103540 [details]
Trying Konsole: Using the same Ubuntu 16.04, the icons of another Qt5/KF5 program like Konsole are correctly seen, instead of showing text descriptions.
Comment 4 Toni Asensi Esteve 2017-01-19 18:00:20 UTC
After a change was made in the Ubuntu 16.04 machine: all the Krusader icons are seen there, there are no broken ones where a long text description must be used.

If you have to use Ubuntu 16.04: the people that work with you... can see how you use a solid, modern and capable program as Krusader :-) (instead of a brokened-icon program). Also, of course, now you can see all the icons (the standard ones and yours) of Krusader at the same time, very good! :-)

What was that change that was made? After some steps the qt5ct program (Qt5 Configuration Tool) was executed and there the GTK+ style (the default one) was selected, the Breeze icon theme was selected in another tab, and so the Breeze icons were used by Qt5 programs after that.
Comment 5 Toni Asensi Esteve 2017-01-19 18:04:19 UTC
Created attachment 103541 [details]
As a consequence, in that Ubuntu 16.04 machine, Krusader icons are now OK.
Comment 6 Toni Asensi Esteve 2017-01-19 18:05:44 UTC
Created attachment 103542 [details]
How Kate icons look now, after the use of qt5ct.
Comment 7 Toni Asensi Esteve 2017-01-19 18:06:26 UTC
Created attachment 103543 [details]
How Konsole icons look now, after the use of qt5ct.
Comment 8 Toni Asensi Esteve 2017-01-19 18:08:16 UTC
There's more information about the qt5ct (Qt5 Configuration Tool) program:

In that Ubuntu 16.04 I executed:
    sudo add-apt-repository -y ppa:nilarimogard/webupd8 # // The Webupd8 team is a popular one
    sudo apt-get update
    sudo apt-get install qt5ct

I edited the ~/.profile file and at the end I added:    
    export QT_QPA_PLATFORMTHEME="qt5ct"
As they wrote: "Then, save the file, log out and after you log in you can use Qt5 Configuration Tool to change the Qt5 style, icon theme and so on."

So after logging in again, I executed:
    qt5ct

I set the Style to GTK+.

I went to the "Icon Theme" tab and selected the "Breeze" icon theme. 

I closed qt5ct 

I executed Krusader and then the Krusader icons were seen correctly (Krusader used then the Breeze icons).    

There are texts about qt5ct in:
    http://www.webupd8.org/2015/11/configure-qt5-application-style-icons.html
    https://askubuntu.com/questions/779796/how-to-integrate-kdenlive-into-the-ubuntu-desktop-design
Comment 9 Toni Asensi Esteve 2017-01-19 18:09:15 UTC
In Ubuntu 16.04, Qt5/KF5 programs use the default icon theme, instead of the Breeze (or Oxygen) icons.

Kate and Konsole didn't really need any change, by default they showed all their icons. Could Krusader be the same way?
Comment 10 Wladimir Palant 2017-02-01 18:48:44 UTC
I can see the same issue using a Git master build (2.5.1-beta, revision 5056272), also Ubuntu 16.04. This affects the configuration dialog in particular, icons for Panel, Colors, Advanced, Dependencies, User Actions are all missing - other icons still show up. AFAICT all the dependencies listed in INSTALL file are installed. I assume that this is a regression from https://github.com/KDE/krusader/commit/3801a39ecbab39dcef534021bd7a90606e397b05, Krusader 2.4.0-beta3 was fine.
Comment 11 Wladimir Palant 2017-02-02 11:04:19 UTC
Created attachment 103771 [details]
Krusader 2.5 settings on Ubuntu 16.04
Comment 12 Wladimir Palant 2017-02-04 07:54:47 UTC
Just a note: no changes with Ubuntu 16.10, same issue.
Comment 13 Wladimir Palant 2017-02-08 14:15:48 UTC
The issue here is that Ubuntu-mono-dark icon theme is being used and that one doesn't have the necessary icons. Using unity-tweak-tool the icon theme can be switched to Breeze for the entire system, then Krusader icons show up correctly. Oxygen on the other hand is missing some icons, Adwaita is missing lots of icon just like the default theme.
Comment 14 Wladimir Palant 2017-02-10 14:43:45 UTC
I have to revise the previous comment. After installing Ubuntu 16.10 from scratch changing the global icon theme no longer helps, Krusader stays stuck without icons - no idea what changed. So I am back to calling QIcon::setThemeName("breeze") from main.cpp. Seeing the inconsistent results, having fallback icons inside the application would really be a good idea.
Comment 15 Alex Bikadorov 2017-02-10 16:04:13 UTC
To avoid confusion, what is this bug actually about:
(1) Breeze theme is installed and should be used. But it's not.
(2) Krusader uses icon(names) that are only included in Breeze and when using a different theme many icons are missing
? 

Regarding the latter, as I see it the general problem is this (similar to bug 372964):
Krusader uses a lot of "breeze only" icons, i.e. the icons are only included in the breeze icon theme and are non-standard(*).
I don't think there is a general solution here. The standard(*) is very limited and a lot of useful and perfectly matching icons are missing. Breeze has a lot more icons, also in comparison with GTK's default icon theme "Adwaita". Kate and Dolphin (and probably most other KDE apps) are using non-standard icons and have the same problems, see screenshots. (Or is this different on your systems?)

The best we can do is lookup for better icon names where QIcon::fromTheme() (http://doc.qt.io/qt-5/qicon.html#fromTheme) fails without Breeze and no icon is shown at all. If there really are alternatives...

Included icons in Krusader which are already included in Breeze is not a good solution.

(*) https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
Comment 16 Alex Bikadorov 2017-02-10 16:05:36 UTC
Created attachment 103957 [details]
Dolphin config page with Adwaita icon theme
Comment 17 Alex Bikadorov 2017-02-10 16:05:54 UTC
Created attachment 103958 [details]
Kate config page with Adwaita icon theme
Comment 18 Wladimir Palant 2017-02-10 19:32:45 UTC
For me as an end user the problem is really that Krusader looks broken on Ubuntu out of the box and there is no obvious way to fix that. Your question is actually about the desired solution:

(1) Krusader only works properly with the Breeze theme so it should just force that theme to be enabled for itself (what I've done in my local build right now).
(2) KDE apps missing icons on Ubuntu is just the way it is, so nothing needs to be done about that.
(3) Expecting icons that the theme might no have is wrong, so Krusader should have fallbacks for the non-standard icons (in my understanding, Krusader 2.4.0 was doing just that but you don't consider that a good solution).

There are also some variants of the above solutions that I can think of:

(1a) Krusader should only force Breeze theme if it somehow detects that the globally selected theme is incomplete. This can be as trivial as blacklisting ubuntu-mono-* and Adwaita, with the assumption that people who changed the default icon theme know what they are doing.
(1b) Krusader could fall back to Breeze for missing icons only (not sure whether this can be done).
(2a) Krusader could warn on missing icons with instructions on how to switch to Breeze, similarly to how it suggests installing konsole.
Comment 19 Wladimir Palant 2017-02-10 19:58:58 UTC
(In reply to Wladimir Palant from comment #14)
> I have to revise the previous comment. After installing Ubuntu 16.10 from
> scratch changing the global icon theme no longer helps, Krusader stays stuck
> without icons - no idea what changed.

Got it: I forgot installing qt5-appmenu. So the instructions for getting icons on Ubuntu seem to be: install breeze-icon-theme, qt5-appmenu, unity-tweak-tool. Log out and log in again (qt5-appmenu environment variable won't be set otherwise). Run unity-tweak-tool to change the global icon theme to Breeze.
Comment 20 Wladimir Palant 2017-02-17 12:39:47 UTC
I finally found a way to make Krusader look well on Ubuntu without messing with the source code. I need to force a KDE platform theme by setting the following environment variables:

  QT_QPA_PLATFORMTHEME=appmenu-qt5:kde
  KDE_SESSION_VERSION=5

Not only does this fix the icons, it also changes the overall theme and for example fixes misaligned text in a bunch of places. So far the only negative side-effect I noticed is the terminal emulator switching to a variable width font. For some reason, changing font there won't persist - you have to create a profile in standalone Konsole, choose a monospace font for it and set it as default. Then you have to create ~/.config/konsolepartrc with these contents:

  [Desktop Entry]
  use_konsole_settings=true

Now the settings from standalone Konsole will be reused, meaning proper font among other things.
Comment 21 Alex Bikadorov 2017-02-20 12:50:48 UTC
*** Bug 376699 has been marked as a duplicate of this bug. ***
Comment 22 albpanig 2017-02-22 13:02:46 UTC
Sorry but I'm newbie

where must I add the statement
> 
>   QT_QPA_PLATFORMTHEME=appmenu-qt5:kde
>   KDE_SESSION_VERSION=5
> 

thanks
Comment 23 Toni Asensi Esteve 2017-02-26 18:13:58 UTC
> Sorry but I'm newbie 
> where must I add the statement [...]

Albpanig, maybe it's easier for you to use the method of https://bugs.kde.org/show_bug.cgi?id=372966#c8 ?
Comment 24 Wladimir Palant 2017-05-10 12:24:09 UTC
For reference, the magic incantation changed in Ubuntu 17.04. The appmenu-qt5 package has been replaced by qtubuntu-appmenutheme. The following environment variables have to be set now:

export QT_QPA_PLATFORMTHEME=ubuntuappmenu
export QTUBUNTU_ICON_THEME=breeze
export UBUNTU_MENUPROXY=0
Comment 25 Alex Bikadorov 2017-11-12 17:52:50 UTC
*** Bug 386554 has been marked as a duplicate of this bug. ***
Comment 26 Toni Asensi Esteve 2017-11-14 19:09:47 UTC
Additionally, if someone wants to see more information about Krusader and Oxygen icons, then this bug report can be seen: https://bugs.kde.org/show_bug.cgi?id=372964
Comment 27 Nikita Melnichenko 2018-03-18 06:34:27 UTC
*** Bug 391899 has been marked as a duplicate of this bug. ***
Comment 28 Nikita Melnichenko 2018-04-22 22:03:40 UTC
Git commit 94ea5b69af14620abd4a44a13240ca9b2749641b by Nikita Melnichenko.
Committed on 22/04/2018 at 22:00.
Pushed by melnichenko into branch 'master'.

Refactored and unified icon rendering, implemented per-icon fallback logic

Merge branch 'fix-missing-icons'

The merged branch contains implementation of per-icon fallback logic:
1. Search icon in the active icon theme — if found, use it.
2. Search it in the icon theme that is specified in Krusader config — if found, use it.
3. Search it in Breeze or Oxygen (in case any of these installed) — if found, use it.
4. Otherwise use a default "icon-missing" icon bundled with Krusader.

FIXED: [ 372964 ] At least one Oxygen icon in Krusader is not correctly seen (using Kubuntu 16.04)
Related: bug 372964, bug 376699, bug 381676, bug 386554, bug 388691, bug 391899

FIXED: [ 372966 ] Some icons are not seen using a plain Ubuntu (not Kubuntu) 16.04

Differential Revision: https://phabricator.kde.org/D10352

M  +11   -10   krusader/kractions.cpp
M  +2    -8    krusader/krusader.cpp

https://commits.kde.org/krusader/94ea5b69af14620abd4a44a13240ca9b2749641b