0.88 Linux. system theme not adhered

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

Moderator: Dreamer

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

Re: 0.88 Linux. system theme not adhered

Post by roland65 » Sat Dec 23, 2017 2:31 pm

[quote="xnview"but it's a gtk 2 theme
https://launchpad.net/ubuntu/+source/gn ... s-standard[/quote]

No, Adwaita is a GTK 3 theme. It's indeed 'the default GTK3 theme'. I guess the gnome-themes-standard package (and its associated package gnome-themes-standard-data) is a compatibility package for GTK2 applications. However, if these packages are not installed, then on Ubuntu 17.10, gnome-tweak-tools doesn't see the Adwaita and Adwaita-dark themes.

User avatar
xnview
Author of XnView
Posts: 30094
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.88 Linux. system theme not adhered

Post by xnview » Sat Dec 23, 2017 4:24 pm

but why is it written? "GTK+ 2 versions of the Adwaita and High Contrast themes"
Pierre.

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

Re: 0.88 Linux. system theme not adhered

Post by roland65 » Sat Dec 23, 2017 7:12 pm

xnview wrote:but why is it written? "GTK+ 2 versions of the Adwaita and High Contrast themes"
I don't know!

If you don't trust me (and I understand), just do this:

cat /usr/share/themes/Adwaita/gtk3/gtk.css

You'll get this:

/* Adwaita is the default theme of GTK+ 3, this file is not used */

User avatar
xnview
Author of XnView
Posts: 30094
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.88 Linux. system theme not adhered

Post by xnview » Sun Dec 24, 2017 2:42 pm

roland65 wrote: You'll get this:
/* Adwaita is the default theme of GTK+ 3, this file is not used */
Adwaita, not Adwaita-dark

I've tried 'speedcrunch -style Adwaita-dark', and i have 'QApplication: invalid style override passed, ignoring it.' too
If i set Adwaita-dark, speedcrunch use it own theme :(

Do you use 'global dark theme'?
Pierre.

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

Re: 0.88 Linux. system theme not adhered

Post by roland65 » Mon Dec 25, 2017 9:26 am

xnview wrote:I've tried 'speedcrunch -style Adwaita-dark', and i have 'QApplication: invalid style override passed, ignoring it.' too
If i set Adwaita-dark, speedcrunch use it own theme :(

Do you use 'global dark theme'?
As I explained in another message:

I did some research on the Internet and found that starting with Qt 5.6, the system GTK theme can't be used directly, as it was the case with previous versions (indeed in Ubuntu 16.04, I used various Qt applications without any theme problem). There seems to be no global solution to this problem, except for the Adwaita theme. For this particular theme indeed, one has to install the package adwaita-qt and call Qt 5 applications with the '-style' parameter and then the Adwaita (or Adwaita-dark) theme is used by the Qt 5 application.

So, you have to install the package adwaita-qt before trying to use the '-style' parameter.

User avatar
xnview
Author of XnView
Posts: 30094
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.88 Linux. system theme not adhered

Post by xnview » Mon Dec 25, 2017 2:22 pm

roland65 wrote:So, you have to install the package adwaita-qt before trying to use the '-style' parameter.
ok, thanks.

If you copy /usr/lib/x86_64-linux-gnu/qt5/plugins/themes in lib folder of XnView, it works!
Pierre.

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

Re: 0.88 Linux. system theme not adhered

Post by roland65 » Tue Dec 26, 2017 8:52 am

xnview wrote:If you copy /usr/lib/x86_64-linux-gnu/qt5/plugins/themes in lib folder of XnView, it works!
I don't have such a folder. Do you mean /usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes ?

User avatar
xnview
Author of XnView
Posts: 30094
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.88 Linux. system theme not adhered

Post by xnview » Tue Dec 26, 2017 11:42 am

roland65 wrote:
xnview wrote:If you copy /usr/lib/x86_64-linux-gnu/qt5/plugins/themes in lib folder of XnView, it works!
I don't have such a folder. Do you mean /usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes ?
after installing adwaita-qt, i have themes subfolder in qt5/plugins
you can search for adwaita.so?
Pierre.

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

Re: 0.88 Linux. system theme not adhered

Post by roland65 » Tue Dec 26, 2017 6:14 pm

xnview wrote:after installing adwaita-qt, i have themes subfolder in qt5/plugins
you can search for adwaita.so?
On Ubuntu 17.10 (artful aardvark), the adwaita.so library is located in /usr/lib/x86_64-linux-gnu/qt5/plugins/styles
So I copied the directory /usr/lib/x86_64-linux-gnu/qt5/plugins/styles to /opt/XnView/lib and launched:

xnview -style Adwaita-dark

and now the Adwaita dark style is correctly applied :-)

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

Re: 0.88 Linux. system theme not adhered

Post by roland65 » Wed Dec 27, 2017 1:55 pm

I found another way to get the system themes applied when using XnView 0.88. Here are the steps:

1. Download the sources of the qt5-style-plugins package (see attached qtstyleplugins-src-5.0.0.tar.gz tarball)
2. Compile the package using Qt 5.9.2 (or use the attached lib.tar.gz tarball that contains the compiled libraries)
3. Copy the 'styles' directory into <install directory>/XnView/lib
4. Copy 'libqtgk2.so' into <install_directory>XnView/lib/platformthemes
5. Launch XnView like this:

xnview -style cleanlooks

or:

xnview -style motif

or:

xnview -platformtheme gtk2

The first command will use the old GTK CleanLooks style. The second commabd will use the old Motif style (not very interesting I admit).

The third command will match *any* GTK2 theme, including the GTK2 versions of Adwaita, Adwaita-dark that are provided with the gnome-standard-themes package. Using this command I can match my custom BlueBird theme, the Ubuntu Radiance theme, etc. However, for some reason, the custom icon theme is not used, instead the default icon theme is used.

Interestingly, I found that:

xnview -style gtk2

crashes XnView. This sounds like a bug, I guess...

Of course, as you already found:

xnview -style Adwaita
xnview -style Adwaita-dark

set the theme to Adwaita or Adwaita-dark if the adwaita.so library is copied into <install_directory>/XnView/lib/styles.

Anyway, perhaps you could provide the missing libraries within the next release of XnView MP? This should help Linux users to match their system theme.
Attachments
lib.tar.gz
(798.3 KiB) Downloaded 23 times
qtstyleplugins-src-5.0.0.tar.gz
(302.82 KiB) Downloaded 20 times

User avatar
xnview
Author of XnView
Posts: 30094
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.88 Linux. system theme not adhered

Post by xnview » Wed Dec 27, 2017 4:10 pm

roland65 wrote: 4. Copy 'libqtgk2.so' into <install_directory>XnView/lib/platformthemes
and the one that i've built doesn't work???
Pierre.

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

Re: 0.88 Linux. system theme not adhered

Post by roland65 » Wed Dec 27, 2017 4:40 pm

xnview wrote:
roland65 wrote: 4. Copy 'libqtgk2.so' into <install_directory>XnView/lib/platformthemes
and the one that i've built doesn't work???
With version 0.88 you only provided libqgtk3.so and xnview -platformtheme gtk3 doesn't work.

User avatar
xnview
Author of XnView
Posts: 30094
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.88 Linux. system theme not adhered

Post by xnview » Wed Dec 27, 2017 5:27 pm

roland65 wrote:
xnview wrote:
roland65 wrote: 4. Copy 'libqtgk2.so' into <install_directory>XnView/lib/platformthemes
and the one that i've built doesn't work???
With version 0.88 you only provided libqgtk3.so and xnview -platformtheme gtk3 doesn't work.
i means this file
could you try to extract this file in XnView/lib/platformthemes/
Pierre.

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

Re: 0.88 Linux. system theme not adhered

Post by roland65 » Thu Dec 28, 2017 8:48 am

xnview wrote:i means this file
could you try to extract this file in XnView/lib/platformthemes/
OK, it works, but only when the library libqgtk2style.so is also contained in the directory XnView/lib/styles, and when launching:

xnview -platformtheme gtk2

Note that, in this case the system icon theme is not used (the widget theme is used however), although it is used when launching xnview without the platformtheme option.

Note also that xnview -style gtk2 crashes XnView...

These theme issues of Qt5 are a real pain!

sissou
Posts: 16
Joined: Wed Nov 08, 2017 9:24 pm

Re: 0.88 Linux. system theme not adhered

Post by sissou » Wed Jan 17, 2018 6:32 am

Anything new with v0.89 ?

On debian Stretch stable I managed to have good looking on qt5 apps (QOwnNotes, VLC) with compiling qt5ct (https://debian-facile.org/viewtopic.php?id=13593).
But it does not work with XNView...

Post Reply