[Out-of-scope] FreeCAD not adopting Desktop theme

A forum for research and development of the user interface of FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
eajmarceau
Posts: 73
Joined: Tue Feb 22, 2022 9:16 pm

[Out-of-scope] FreeCAD not adopting Desktop theme

Post by eajmarceau »

The only conversation that comes close to the issue I raise is that in
https://forum.freecadweb.org/viewtopic. ... &start=110 , but it seems to focus on other aspects of appearance.

When I open FreeCAD 0.18.4, FreeCAD adopts the colouring from my Desktops default theme, which is dark, on UbuntuMATE. I looks like this, which is what I prefer:
FreeCAD 0.18.4 adopts Desktop theme correctly.
FreeCAD 0.18.4 adopts Desktop theme correctly.
Image_1__FreeCAD_0.18.4.png (155.01 KiB) Viewed 2296 times

When I open FreeCAD 0.19, FreeCAD appears to ignores colours from the Desktop theme.

I looked thru preferences, but there is no mention there of a built-in option for light/dark interface, nor an option to adopt/ignore the Desktop theme's colouring scheme, resulting in the following appearance:
FreeCAD 0.19 ignores Desktop theme.
FreeCAD 0.19 ignores Desktop theme.
Image_2__FreeCAD_0.19.png (166.51 KiB) Viewed 2296 times

Is there some manual technique to circumvent this restriction? A assumed fixed configuration file which can be modified?

Please note that I am using the following binary:
FreeCAD_0.19.3-Linux-Conda_glibc2.12-x86_64.AppImage
Attachments
FreeCAD_0.18.4.png
FreeCAD_0.18.4.png (155.01 KiB) Viewed 2296 times
Last edited by eajmarceau on Sun May 08, 2022 6:35 pm, edited 1 time in total.
User avatar
onekk
Veteran
Posts: 6205
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: FreeCAD not adopting Desktop theme

Post by onekk »

FreeCAD is using Qt.

Mate is using GTK.

There are ways to make Qt use same theme settings or "replicate the behaviour" of a Gtk Theme.

But they are "two different world".

This "translation" however is not perfect, as Tollkits are different.

This is "a fact" that is shared among many other programs, there are "workarounds" and they depend on some external programs, and system settings.

You could try to make some search about "Qt and Gtk appearance" and see if something will work for you.

EDIT: FC has a dark theme, i dont' know when it was implemented, as something is changed between 0.19 and 0.20, and I'm using 0.20, try to search something about "FreeCAD dark theme" in this forum, probably with a "web engine" as internal forum search probably will complains about "too common terms in search"


Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
eajmarceau
Posts: 73
Joined: Tue Feb 22, 2022 9:16 pm

Re: FreeCAD not adopting Desktop theme

Post by eajmarceau »

Thank you, Carlo. I tried version 20 and as you mentionned, there is a colour theme drop-down menu option. That worked very well.

Just one comment about that: It seemed (I might be wrong) that the set of colours for various GUI actions/highlighting is constant, rather than having a set of colours that best fits each of those theme options. I had to go in to modify the colours to some that are actually usable instead of what was default for the "ProDark" theme.

These are colours that seemed to have better contrast, IMHO.
Colour Scheme providing better contrast for viewing with dark background.
Colour Scheme providing better contrast for viewing with dark background.
Tweek__ColourScheme.png (110.69 KiB) Viewed 1935 times
- FreeCAD Version 0.20
- Kernel: 5.4.0-107-generic x86_64 bits: 64 compiler: gcc v: 9.4.0 Desktop: MATE 1.24.0 info: mate-panel wm: marco 1.24.0 dm: LightDM 1.30.0 Distro: Ubuntu 20.04.4 LTS (Focal Fossa)
- Graphics: Device-1: Advanced Micro Devices [AMD/ATI] RS780D [Radeon HD 3300] vendor: ASUSTeK driver: radeon v
User avatar
onekk
Veteran
Posts: 6205
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: FreeCAD not adopting Desktop theme

Post by onekk »

eajmarceau wrote: Tue Apr 05, 2022 2:14 am Just one comment about that: It seemed (I might be wrong) that the set of colours for various GUI actions/highlighting is constant, rather than having a set of colours that best fits each of those theme options. I had to go in to modify the colours to some that are actually usable instead of what was default for the "ProDark" theme.
Probably it is better to make a similar post in the UX/UI section of the forum, where the Theme matters are discussed.

I think that maybe here, some improvement could be done, maybe not for 0.20 "stable" but for "0.21dev" (1.0 maybe) this improvement I think will be appreciated.

I don't like too much dark themes, probably I'm old school, having started with a C64 with a TV as monitor and having done some programming on old "IBM AT 286" with monochrome monitor with "green pixels", when color have permitted to use "white background" I was so pleased that I'm already not prone to "return to origins" :-D

PS: I check the contrast in the monitor to avoid to much light, or prefer some "pastel color" for background, I know that "dark themes" have some "good reasons to exist".

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
wmayer
Founder
Posts: 20305
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FreeCAD not adopting Desktop theme

Post by wmayer »

eajmarceau wrote: Sat Apr 02, 2022 4:10 am When I open FreeCAD 0.18.4, FreeCAD adopts the colouring from my Desktops default theme, which is dark, on UbuntuMATE. I looks like this, which is what I prefer:
Is this an AppImage or does it use your system Qt version? What version is that?
When I open FreeCAD 0.19, FreeCAD appears to ignores colours from the Desktop theme.
Which Qt version is that?
I looked thru preferences, but there is no mention there of a built-in option for light/dark interface, nor an option to adopt/ignore the Desktop theme's colouring scheme, resulting in the following appearance:
In FreeCAD there are no settings to actively suppress to use the desktop theme. If you set a Qt style sheet file this is used and if no style sheet is selected the default desktop theme is supposed to be used.

What I can imagine is that for the AppImage a Qt plugin is missing that would "translate" GTK appearance into Qt appearance. When you check the content of the AppImage is there a file called libqgtk3.so?

But I wonder why your v0.18 apparently uses the theme icons while v0.19 uses FreeCAD default icons. I don't know if this can be caused by the lack of a plugin.
wmayer
Founder
Posts: 20305
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FreeCAD not adopting Desktop theme

Post by wmayer »

wmayer wrote: Thu Apr 07, 2022 6:40 am But I wonder why your v0.18 apparently uses the theme icons while v0.19 uses FreeCAD default icons. I don't know if this can be caused by the lack of a plugin.
It shows that removing the libqgtk3.so plugin causes FreeCAD to use the built-in FreeCAD icon theme.
When you check the content of the AppImage is there a file called libqgtk3.so?
Here I have an AppImage for version 0.19-23141 and that lacks of the libqgtk3.so plugin.
wmayer
Founder
Posts: 20305
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FreeCAD not adopting Desktop theme

Post by wmayer »

On Ubuntu there is a package called qt5-style-plugins that provides libqgtk2style.so that seems to be needed in order to follow more or less the desktop scheme. Even with the system Qt version FreeCAD ignores the desktop scheme if this package is not installed.

There is an additional package qt5ct that allows to adjust the provided Qt styles. In order to start the application you must set the environment variable:

Code: Select all

export QT_QPA_PLATFORMTHEME=qt5ct
eajmarceau
Posts: 73
Joined: Tue Feb 22, 2022 9:16 pm

Re: FreeCAD not adopting Desktop theme

Post by eajmarceau »

Thank you, wmayer, for looking at this and your comments.

In my original post, I indicated that the latest version used was

Code: Select all

FreeCAD_0.19.3-Linux-Conda_glibc2.12-x86_64.AppImage
More details at bottom.

The version of 0.18.4 used was provided with the UbuntuMATE 20.04 LTS distro, namely

Code: Select all

0.18.4+dfsg2-1ubuntu4
For package "qt5ct", I found that and installed it. I will let you know how that modifies the behaviour that I see in FreeCAD.

For package "qt5-style-plugins", that is not available in my 20.04 LTS distro. I also looked for each of "libqgtk2style.so, "libqgtk2style", "libqgtk2" and "gtk2style" ... and found nothing.

UbuntuMATE 22.04 is coming out soon. I will be sure to revisit your suggestions when I have upgraded my OS. Hopefully, all necessary packages will be included in that LTS distro.


----------------------------------------------------------------------------------------------------------
Version: (dowloaded from FreeCAD site)
FreeCAD_weekly-builds-28611-Linux-Conda_glibc2.12-x86_64.AppImage (used to verify issue), and
FreeCAD_0.19.3-Linux-Conda_glibc2.12-x86_64.AppImage (used to verify issue), and
FreeCAD 0.18.4 (primary tool; from LTS distro)

Distro: Ubuntu 20.04.4 LTS (Focal Fossa)
Kernel: 5.4.0-107-generic x86_64 bits: 64 compiler: gcc v: 9.4.0
Desktop: MATE 1.24.0 info: mate-panel wm: marco 1.24.0 dm: LightDM 1.30.0

CPU: Speed: 800 MHz min/max: 800/2600 MHz
Mobo: ASUSTeK model: M4A78-E v: Rev 1.xx
CPU: Topology: Quad Core model: AMD Phenom II X4 810 bits: 64 type: MCP arch: K10
Memory: RAM: total: 3.59 GiB used: 2.04 GiB (56.7%)
Graphics: Device-1: Advanced Micro Devices [AMD/ATI] RS780D [Radeon HD 3300] vendor: ASUSTeK
Drives: Local Storage: total: 1.82 TiB used: 967.00 GiB (51.9%)
User avatar
adrianinsaval
Veteran
Posts: 5548
Joined: Thu Apr 05, 2018 5:15 pm

Re: FreeCAD not adopting Desktop theme

Post by adrianinsaval »

the version from apt has access to whatever qt style your system has, the appimage doesn't have it, if you used 0.19 or 0.20 from the ppa it will likely work. I don't think including those styles in the appimage makes much sense, if whatever this one is is included then the next style that doesn't work should be added too (I would love to have breeze on the appimage for example), were do we draw the line? Also if it is the gtk2 style, that one is pretty buggy IIRC so not a good idea anyways.
Post Reply