-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bundle themes #60
Comments
If this means my Qt application will look more native on a GTK sytem - yes, definitely. |
Which of the platformthemes are the "standard" ones and should be copied in? Can you send a PR? |
I don't see such a folder in my Qt installation. I can't send a pr in, sorry. |
libqgtk2.so to have a gtk look on qt5 |
You would need all plugins I would say. Plus QT_PLUGIN_PATH}/styles Now there is a bit of a chicken and egg situation here. If you just add the ones which are installed on the machine the appimage gets packed, you will miss out some which are installed on the target system. You cannot guess which style/theme is used on the target systems. So if you do not ship with all, the appimage will look like an alien in some target systems. So I guess its the best to have a list of all possible qt5 styles' and themes' .so files beforehand (the most common, I count 8 at archlinux wiki), and compare these with the ones installed in the qt5 installation of the machine the appimage gets packed, and then inform/warn the user of the fact that if he does not have all the platformthemes and styles installed in his plugins folder, that his app will not look right in different target systems. If applicable, it would be wise to host these plugins here on github, (for each qt version I guess - or maybe one set of .so's work across more than one version/qtbase-abi...?), and insert them automatically. Or provide a quick apt-get install or yum install list suggestion depending on the distro linuxdeployqt is run on, or maybe ask the user if linuxdeployqt itself should install these themes/styles via package system before building the appimage. |
Can't Qt be made look for platform themes in one place and the rest in another? How do they solve it on Windows/macOS? |
It is super important never to mix Qt versions. So if we bundle Qt (which we do) we must make sure that Qt themes are never loaded from the system or else we will crash. Check out the Krita AppImage, it ships with a dark Qt theme. |
I suspected that. The way to solve it, from my point of view, is to ship the themes and styles, with ALL their dependencies, that is, you also will need to package GTK it you plan to also support libqgtk2.so (and related) themes. That is for sure overkill for the average user, but some definitely strive to have a consistent desktop experience for their Apps, and a Dark theme does not necessarily help there. What would be nice from a user perspective would be to have a possibility to ship the themes with all the dependencies if demanded, e.g. through an extra flag, and that the User is being hinted/warned that when generating the Appimage as it happens now, theme inconsistencies are gonna happen. |
No, since we consider Gtk+2 to be ABI stable and part of each target system. So we would "only" have to bundle all Qt-GTK parts (libraries, plugins, themes, whatever is needed), if a certain extra flag was specified. PR welcome! |
libgtk2.0 is part of a kde-based distro? ok, here are the dependecies of the platformthemes and styles: libqgtk2.so libqcleanlooksstyle.so breeze.so oxygen.so so for breeze, qtcurve, oxygen as default, one would have to ship parts of kde libs... I now query the QT_QPA_PLATFORMTHEME variable of the system and then set the theme accordingly. But doing so, on a system where QT_QPA_PLATFORMTHEME is set to gtk2, and with the gtk2 platformtheme and style installed, results in this error (vanilla xubuntu 17.10 daily image)
as well as this appearance: instead of If I try to install the qt5-gtk-platformtheme plugin via debian package in xubuntu 17.10, it shows these dependencies
|
Try running with |
https://pastebin.com/8bUR910v and it tries to find all the libs I get when installing libgnomeui-0, that is
I found elsewhere this answer to install libgnomeui-0 when searching for a solution to "could not resolve GTK". Obviously, when I try to install these on the target system via package-manager, the app tries to link against them, which results in a segfault. So I am not entirely shure about ABI stability helps here. So you will have to ship all these libs in the appimage for proper theming. You will have to rethink that anyways if you get kde-based themes into play, as well as qt5.8+ switching the theme /style plugins to gtk3... |
I'm asking myself whether it's a good idea to depend on GNOME when all we (probably) really want is to render in Gtk+ 2. What exactly pulls in libgnomeui-0? |
nothing I guess - but the style does not work when its not bundled. Even if the style now works, the theme (the color which is set in the system theme, that is, does not... |
Some Qt expert is needed here. Maybe ask on the Qt mailing list how this needs to be deployed so that it works. |
Interesting: The AppImages from https://download.opensuse.org/repositories/home:/rncbc/AppImage/ look correctly themed on XFCE: See AppImage/AppImageKit#125 for further analysis. Turns out that this could be achieved whithout the need to bundle platformthemes or anything else. |
Seems to be fixable when using Qt 5.9.3 and copying the platform themes to the AppDir. See e.g., probonopd/quassel@b75a57c. |
With the platformtheme, the font now looks like in XFCE but the colors still don't... |
Probably due to the lack of a pretty GTK(3?) theme for XFCE (uses GTK2). Some Qt apps lack a "native" look on my xubuntu 16.04. Might not even be the platform themes' fault. Another idea: we might bundle the wrong one. On my system, the only available platform theme is |
If true, then I want the gtk2 platformtheme back. And we need a KDEPlatformTheme.so as well. If I remember correctly someone had made a special version with few dependencies for use with AppImage. |
Is just using Qt 5.9.3 and the latest We upgraded to 5.9.3 but I don't see a change in theming - it's still using Fusion. |
@vadi2 check whether your AppImage contains a directory |
The AppImage is available at https://transfer.sh/WNlqb/Mudlet-3.5.0-testing-963e49b.AppImage and I'm running Ubuntu 17.04. |
The platform themes are bundled properly here. It's actually all about Please list the contents of |
Not much more to it:
|
Just wanted to comment that so far the AppImages probonopd linked above and the AppImage for Cantata are the only Qt based AppImages that I've used so far that will actually follow my GTK or Qt color theme. I've tried quite a few Qt based AppImages on both Xfce and LXQt, and none other than the ones linked above and Cantata follow my system color theme. The color themes for all of the apps I've tested (at least ones available in my repos) work fine when using the versions of these programs installed through my package manager. Quassel, keepassxc, notepadqq, and simplescreenrecorder are just a few that come to mind that I've tested that do not follow my system theme when using the AppImage release. |
@simoniz0r you can safely consider the stuff on Bintray outdated at any time. You shouldn't use them for productive work anyway. The keepassxc and notepadqq builds seem outdated, too. They might not be the best candidates for verifying this behavior. But you can use https://github.com/TheAssassin/mumble as another test object. |
No, it does not @probonopd Installed through my package manager: AppImage: |
@TheAssassin Your AppImage build of Mumble does not follow my system colors or fonts either. |
For reference, can you also post a screenshot of an AppImage from https://download.opensuse.org/repositories/home:/rncbc/AppImage/ and describe your system (which OS, version, desktop environment, etc.), please. This will help us a lot. |
After doing some more testing, it seems that only qxgedit and qtractor from the link above use my system theme. I'm thinking this may be because I'm using LXQt's option to use a GTK theme to theme Qt applications. Both qxgedit and qtractor have an option that lets me use the GTK theme for the app, and they use the GTK theme that I have set using lxappearance. Cantata also has an option to use the GTK theme, and it works the same way. Any Qt apps that are packaged in AppImages that do not have the option built in to use the system's GTK theme do not follow the GTK theme that my system is using. They seem to just fall back to a default Qt theme and font. When I install these applications through my system's package manager using the same theme settings, they follow my system's theme as expected. It would seem to me like the AppImages that are working with my system theme are applications that have been built with GTK theme support regardless of what package they're being delivered in. As you can see below, both qxgedit and Cantata have the option for me to use the system's GTK theme. I know that for Cantata, this is something that is in all of the package releases. It's also worth noting that the AppImage release of Cantata will only use my system theme when I go into Cantata's settings and tell it to use the GTK theme. When I install it through my package manager, it uses my system theme when I have the option set to system default. |
edb-qt56-continuous-git.6fcbf13-x86_64.AppImage on XFCE is using the system's theme, looks almost like a native XFCE application: It ships with the |
@probonopd how sure are you it won't load the system theme file when removing it from the bundle...? strace might help here. |
The same AppImage does not follow my system theme at all on LXQt. https://transfer.sh/gjO1r/edb-qt56-continuous-git.6fcbf13-x86_64.AppImage |
Strange. We still don't know why it is behaving so differently with different system/Qt combinations. |
Like I said before, the only Qt AppImages that follow my system theme are applications that have been built with GTK support and have an option to switch to GTK based theming. No other Qt AppImages follow my system theme. |
How does one do that? |
Sorry, no idea on that one; I'm not a Qt dev... You might try asking someone like CDrummond who works on Cantata or the qxgedit developer. |
What do people think of
Unfortunately it seems to be using the more complex and "moving target" Gtk+ 3 rather than the mature Gtk+ 2. |
Tried it out and it didn't work: CrimsonAS/gtkplatform#23 GTK+ 2 isn't mature btw, it's deprecated - the last release was 8 years ago. An application using GTK+ 2 now would look out of place in a modern desktop. |
According to https://askubuntu.com/a/910143,
So, bundle the GTK2 platform theme and style? |
Yes, that does the trick:
|
As the AppImageKit issue closed, what's the status on this one? Can platformthemes be bundled and how to make sure the version is compatible with the host version? Specifically QGnome |
The issue is that if you bundle QGnome, then you need to bundle all of its dependencies, too - since you can't assume Gnome to be present on all systems. And in practice, this can lead to all kinds of difficulties. So over the years the contributors in this project have come to the conclusion that it's not worth the effort, but ymmv. You'd have to use another tool for that, though. |
@probonopd I think you're confusing Qt platform themes with desktop environments. QGnomePlatform theme is quite lightweight and doesn't require any GNOME dependencies.
As you can see, there's nothing whatsoever that involves any of GNOME libraries other than Gtk3. And if Gtk3 is not present on target system, the platform plugin would just not load, so noop. What difficulties you're talking about? |
if that is how it works, then it's good. But I remember that back in the time when we bundled Gtk Qt platform themes, we eventually ran into issues that made us decide it was not worth keeping them. If you are interested in the details: |
@probonopd It looks like the issue is not that Gtk is not present, but that it is loaded from the system and has incompatibility issues. Either it's a configuration issue or a binary incompatibility with bundled libraries. That's indeed a valid issue. Typically, AppImage doesn't load libraries and resources from the system. So this issue is not specific to the platform themes, but to any library that is loaded by AppImage from the system. Are there successful examples where AppImage loads a *.so from the system and it works? |
Should we do `cp -a "${QT_PLUGIN_PATH}/platformthemes"?
The text was updated successfully, but these errors were encountered: