Ticket #4130 - Style sheet in Ubuntu (and others) not loaded on startup

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Blunt0
Posts: 13
Joined: Mon Jun 10, 2019 6:59 pm

Ticket #4130 - Style sheet in Ubuntu (and others) not loaded on startup

Postby Blunt0 » Mon Jun 10, 2019 7:31 pm

Hi, I have been using FreeCAD the last month, coming from a animation background (blender/maya), and so far I am loving FreeCAD for technical parts.

I have a minor issue with FreeCAD 0.18 on Ubuntu 18.04.2 LTS (with the appimage provided on the FreeCAD website).

If I set the style sheet, to for example dark blue, it works fine, however if I close and restart, these settings are not remembered.
The weird thing is that it does remember other preference settings, like msaa, and tesselation settings.

Now for FreeCAD 0.18 this is not a major issue, as it just grabs my desktop theme, and I am fine with that.

However if I use the following linked version of FreeCAD (by realthunder), then FreeCAD for some reason does not grab the darktheme from my desktop, but the light theme, which is annoying, and I have to set the style sheet on each startup to a dark version.
Link to fork: https://github.com/realthunder/FreeCAD_ ... 3/releases

A solution would be to either be able to set the theme permanently in freecad, or to have the realthunder fork recognize my dektop theme.

Did anyone have the same issue and found a solution?
openBrain
Posts: 2174
Joined: Fri Nov 09, 2018 5:38 pm

Re: Style sheet in Ubuntu not loaded on startup.

Postby openBrain » Mon Jun 10, 2019 8:09 pm

Hi Blunt0, Welcome here.
Could you post your FC info as indicated in the link located in the banner on top of the page ?
Could you also give some more clues about how you set the stylesheet ?
Blunt0
Posts: 13
Joined: Mon Jun 10, 2019 6:59 pm

Re: Style sheet in Ubuntu not loaded on startup.

Postby Blunt0 » Mon Jun 10, 2019 8:18 pm

Hi OpenBrain, certainly I can.

How I set the style sheet:
Edit > Preferences > General > General > Main window > Style sheet > :dropdown menu set to "Dark-Blue" > Apply:ButtonPress.
(hope that makes sense)

This is the appimage downloaded from the FreeCAD website:
OS: Ubuntu 18.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16117 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.18.2)
Hash: dbb4cc6415bac848a294f03b80f65e888d531742
Python version: 3.6.7
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)


This is the fork from realThunder:
OS: Ubuntu 18.04.2 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16830 +1496 (Git) AppImage
Build type: Release
Branch: LinkStage3
Hash: 1b29767b545440b7ab93f1a5f2b742d622f1b547
Python version: 3.6.7
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
openBrain
Posts: 2174
Joined: Fri Nov 09, 2018 5:38 pm

Re: Style sheet in Ubuntu not loaded on startup.

Postby openBrain » Mon Jun 10, 2019 8:51 pm

Can't reproduce here. I'm still using 0.18.1 (looks like 0.18.2 hasn't yet be propagated to the distro repo).
Hoping AppImage uses the same config files location, you should have a file at

Code: Select all

~/.FreeCAD/user.cfg
Inside this file is a line with something like

Code: Select all

<FCText Name="StyleSheet">
Could you check this is correctly updated when you change and save the stylesheet setting ?

Edit : typo in user.cfg path
Last edited by openBrain on Mon Jun 10, 2019 9:55 pm, edited 1 time in total.
Blunt0
Posts: 13
Joined: Mon Jun 10, 2019 6:59 pm

Re: Style sheet in Ubuntu not loaded on startup.

Postby Blunt0 » Mon Jun 10, 2019 9:41 pm

Hmm, I can not find a ".FreeCAD.user.cfg" anywhere on my system (using search quires on my hard drive), also not in my home folder.
I am also new to linux, so maybe I am doing something wrong.
openBrain
Posts: 2174
Joined: Fri Nov 09, 2018 5:38 pm

Re: Style sheet in Ubuntu not loaded on startup.

Postby openBrain » Mon Jun 10, 2019 9:54 pm

:oops: ouch sorry :

Code: Select all

~/.FreeCAD/user.cfg
~ is your home
.FreeCAD is a hidden folder
Blunt0
Posts: 13
Joined: Mon Jun 10, 2019 6:59 pm

Re: Style sheet in Ubuntu not loaded on startup.

Postby Blunt0 » Mon Jun 10, 2019 10:07 pm

Thanks,

When I set style sheet to "No style sheet" in FreeCAD GUI I get this:
<FCText Name="StyleSheet">

When I set style sheet to "Dark-Blue" in FreeCAD GUI get this:
<FCText Name="StyleSheet">
/tmp/.mount_FreeCAQuzP8W/usr/data/Gui/Stylesheets/Dark-blue.qss
</FCText>


If I search in the config document for "stylesheet" I can also find this:
<FCBool Name="UseStyleSheet" Value="0"/>
openBrain
Posts: 2174
Joined: Fri Nov 09, 2018 5:38 pm

Re: Style sheet in Ubuntu not loaded on startup.

Postby openBrain » Mon Jun 10, 2019 10:25 pm

:!: Your qss style sheet path is in the temporary folder. And thus probably a temporary mount point. :!:
It explains why your configuration doesn't work correctly. Actually the setting itself is correctly saved, but the worksheet has a path that changes (probably each time FC is launched).
It seems specific to how AppImage works. Could be good to ping the packager but I don't know who it is.
Time to sleep here. :) I'll look deeply on tomorrow if needed, but hopefully some other forumers may help in between (magics of timezone). ;)
Blunt0
Posts: 13
Joined: Mon Jun 10, 2019 6:59 pm

Re: Style sheet in Ubuntu not loaded on startup.

Postby Blunt0 » Mon Jun 10, 2019 10:34 pm

It seems to be that way, thank you for your help, and have a good night.
openBrain
Posts: 2174
Joined: Fri Nov 09, 2018 5:38 pm

Re: Style sheet in Ubuntu not loaded on startup.

Postby openBrain » Tue Jun 11, 2019 7:36 am

sgrogan wrote: Ping @FC release publisher
@sgrogan, maybe you can be of some help here.
May I guess right that this is due to way that AppImage works ?
Is that a bug that deserve a ticket, or should this just be considered as a drawback of AppImage ?