Reload Stylesheet

Find and share HowTos to various installations / configurations!
Search

Post Reply
4 posts • Page 1 of 1
etmKnut
Posts: 7
Joined: Tue Dec 11, 2018 8:14 am

Reload Stylesheet

Post by etmKnut »

I have a stylesheet applied to the tree widget, but when i change a color theme in runtime the tree wiget color doesnt change until i reload the stylesheet.

I have only found a way to do it in Gedi: Edit -> reload stylesheet.


Question: How can i reload the stylesheet from script in runtime?

dbindernagel
Posts: 151
Joined: Mon Feb 23, 2015 1:34 pm

Re: Reload Stylesheet

Post by dbindernagel »

Have a look at "setApplicationProperty".
https://www.winccoa.com/documentation/W ... perty.html

Afaik this does reapply the chached stylesheet but does not reload the file (and therefore any changes made in the file).
Also there is a stylesheet property on the widgets that may help.

etmKnut
Posts: 7
Joined: Tue Dec 11, 2018 8:14 am

Re: Reload Stylesheet

Post by etmKnut »

Thanks, but no. These two doesnt work. For some reason the Tree-widget elements doesn't recognize theme change... the background does, but not the elements...

I think i need a full reload. Is there a way to get a hold of the function behind "Reload StyleSheet" in Gedi?

gschijndel
Posts: 330
Joined: Tue Jan 15, 2019 3:12 pm

Re: Reload Stylesheet

Post by gschijndel »

That example only reapplies the cached/processed stylesheet as it applies exactly what is already active.

So for an actual reload you would need to read all stylesheet contents from the (sub)projects into a single string and the touchscreen stylesheets if applicable and use that to set the application property.

Would be nice to share the code in a community repository, where all can contribute.

Post Reply
4 posts • Page 1 of 1