0.88 Linux. system theme not adhered

*** Please report new bugs here! ***

Moderators: XnTriq, helmut, xnview, Dreamer

roland65
Posts: 38
Joined: Wed Apr 19, 2017 11:53 am

Re: 0.88 Linux. system theme not adhered

Post by roland65 »

sissou wrote:Is this the same kind of problem ?
Could you try this one?
Attachments
lib-qt5.9.3-v2.tar.gz
(225.33 KiB) Downloaded 48 times
sissou
Posts: 20
Joined: Wed Nov 08, 2017 9:24 pm

Re: 0.88 Linux. system theme not adhered

Post by sissou »

No change in icon theme with these new files !
roland65
Posts: 38
Joined: Wed Apr 19, 2017 11:53 am

Re: 0.88 Linux. system theme not adhered

Post by roland65 »

sissou wrote:No change in icon theme with these new files !
That's bad luck for you! On my Ubuntu boxes, these new libs fix the folder icons (see attached screenshot).
Attachments
xnview_089.png
sissou
Posts: 20
Joined: Wed Nov 08, 2017 9:24 pm

Re: 0.88 Linux. system theme not adhered

Post by sissou »

Here's how XNView interface does look on my session :
Capture d’écran_2018-01-22_21-29-08.png
No luck indeed :|
sissou
Posts: 20
Joined: Wed Nov 08, 2017 9:24 pm

Re: 0.88 Linux. system theme not adhered

Post by sissou »

It was working a few versions ago though...
roland65
Posts: 38
Joined: Wed Apr 19, 2017 11:53 am

Re: 0.88 Linux. system theme not adhered

Post by roland65 »

sissou wrote:It was working a few versions ago though...
So you are french too ;-)

More information about my system:
Ubuntu 16.04
XFCE 4

When I launch XnView 0.89 without the -platformtheme gtk2 option, the correct desktop icon theme (blue folder icon in my case) is selected.

I can change the desktop icon theme using 'xfce4-appearance-settings' and then XnView (without the platformtheme option) reflects the selected icon theme.

So you could first try to launch XnView without parameter and try to get the correct desktop icon.
sissou
Posts: 20
Joined: Wed Nov 08, 2017 9:24 pm

Re: 0.88 Linux. system theme not adhered

Post by sissou »

Unfortunately, launching XNViewMP without -platformtheme gtk2 options does not display correct icons (papirus)...
... but I'm on debian stable, there must be many differences.
So you are french too ;-)
Yes I am :)
roland65
Posts: 38
Joined: Wed Apr 19, 2017 11:53 am

Re: 0.88 Linux. system theme not adhered

Post by roland65 »

sissou wrote:... but I'm on debian stable, there must be many differences.
Not so much, because Ubuntu is based on Debian...

In fact, the problem is that there is no folder.png in your icon theme, which is pure SVG. On my system, I use a PNG icon theme and this one works, while the default Adwaita (pure SVG) doesn't.

Here is a possible solution. I assume you use the Papirus icon theme with a black folder icon (as I saw from your screenshot).

1. Convert to PNG the SVG icon you want for the folders. For example:
inkscape -d72 -w32 -h32 -e folder.png folder-black.svg

2. Copy folder.png to /usr/share/icons/Papirus/32x32/places

3. Update the icon cache (as root):
update-icon-caches /usr/share/icons/Papirus

4. Launch 'xnview' (without option) and you should see the correct folder icon

5. Launch 'xnview -platformtheme gtk2' (using the last version of the libraries I provided) and you should see the correct folder icon *and* the correct widget theme

Perhaps there will be other icons for which we'll have to do the same, I don't know.

And of course, the inkscape PNG conversion is a little rough, but the PNG icon can be improved using Gimp (using a sharpen filter, for example).
sissou
Posts: 20
Joined: Wed Nov 08, 2017 9:24 pm

Re: 0.88 Linux. system theme not adhered

Post by sissou »

Excellent !
It is OK with adwaita icons theme, but not with Papirus theme, and I can't find out what the difference between these two themes...
roland65
Posts: 38
Joined: Wed Apr 19, 2017 11:53 am

Re: 0.88 Linux. system theme not adhered

Post by roland65 »

sissou wrote:Excellent !
It is OK with adwaita icons theme, but not with Papirus theme, and I can't find out what the difference between these two themes...
OK, in the /usr/share/icons/Papirus/index.theme file, replace the line:

Inherits=breeze,ubuntu-mono-dark,gnome,hicolor

with:

Inherits=breeze,ubuntu-mono-dark,hicolor

and it should work.

Anyway, you can find here a Papirus icon theme that works for me with Xnview 0.89 under Gnome and XFCE desktops...
sissou
Posts: 20
Joined: Wed Nov 08, 2017 9:24 pm

Re: 0.88 Linux. system theme not adhered

Post by sissou »

Thanks !
Icon theme is now OK in XNView, thanks to you !

You are a real master ;-)
roland65
Posts: 38
Joined: Wed Apr 19, 2017 11:53 am

Re: 0.88 Linux. system theme not adhered

Post by roland65 »

sissou wrote:Thanks ! You are a real master ;-)
You're welcome. These theme issues can be tricky on Linux...
I'll try to summarize the steps for the benefits of other users...
roland65
Posts: 38
Joined: Wed Apr 19, 2017 11:53 am

Re: 0.88 Linux. system theme not adhered

Post by roland65 »

So, here is a summary of a workaround for this bug (works with XnView MP version 0.89, on Linux systems):

1. Download the attached archive lib-qt5.9.3.tar.gz
2. As root, extract this archive to /opt/XnView
3. As a user, launch XnView with the command :
xnview -platformtheme gtk2

You should see the correct GTK system theme applied. If the folder icons are not the correct ones (i.e. brown Gnome folder icons or blue Qt folder icons), that's because the theme you use is pure SVG and does not contain the required folder.png icon file for each size.

To overcome this problem, do the following:

1. Convert to PNG the SVG icon you want for the folders. For example, for a 32x32 folder icon:
inkscape -d72 -w32 -h32 -e folder.png folder.svg

(You can improve the rendering of the converted PNG icon in XnView by opening the folder.png image in GIMP and use the menu Image / Mode / Indexed... and click on the 'Convert' button. Then save back the image to folder.png.)

2. Copy folder.png to /usr/share/icons/<your theme>/32x32/places
Do the same for the other resolutions: 16x16, 22x22, etc.

3. As root, edit the file /usr/share/icons/<your theme>/index.theme and check if there is a line that start with the keyword 'Inherits'. If not, that's OK. If yes, remove the 'gnome' word if it's present on the line. Then save the file.

3. Update the icon cache (as root):
update-icon-caches /usr/share/icons/<your_theme>

4. Launch 'xnview' (without option) and you should see the correct folder icon

5. Launch 'xnview -platformtheme gtk2' (with of course the lib-qt5.9.3.tar.gz extracted to the correct place) and you should see the correct folder icon *and* the correct widget theme.

For those who want to recompile the libraries, I attached the qt-style-plugins-src-5.0.0.tar.gz source package with the patch I used. First apply the patch, then recompile the package using Qt 5.9.3 (I used the qt-opensource-x64-5.9.3.run distribution to build the libraries).
Attachments
qtstyleplugins-src-5.0.0.tar.gz
Source package with patch
(306.62 KiB) Downloaded 43 times
lib-qt5.9.3.tar.gz
Compiled libraries (with Qt 5.9.3)
(225.33 KiB) Downloaded 58 times
jooch
Posts: 8
Joined: Mon Nov 06, 2017 5:59 pm

Re: 0.88 Linux. system theme not adhered

Post by jooch »

I let the issue rest a while hoping a solution would come up in time, but even in 0.90rel1 i still have this bug.

I need to keep fontconfig (2.12.5-1) and XnView (0.87) downgraded because of that, and thus i now also need to keep pango downgraded.

Roland's solution doesn't work for me since he's not on an Arch based system.
jooch
Posts: 8
Joined: Mon Nov 06, 2017 5:59 pm

Re: 0.88 Linux. system theme not adhered

Post by jooch »

jooch wrote: Sun Apr 15, 2018 12:37 pm ...
Roland's solution doesn't work for me since he's not on an Arch based system.
Ah, finally, I figured it out. It turned out it was just my old profile somehow blocking the patch from working. Since i copied this profile to all my other systems they did not work either. Excuse any confusion because of this.

I also made a patch including a modified xnview.sh, just extract the archive with:

Code: Select all

sudo tar -xzvf xnview-patch.tar.gz -C /opt/xnviewmp/
Now everything works as it should, thanks again Roland!
Attachments
xnview-patch.tar.gz
(227.24 KiB) Downloaded 67 times
Post Reply