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?
Reload Stylesheet
Search
-
- Posts: 151
- Joined: Mon Feb 23, 2015 1:34 pm
Re: Reload Stylesheet
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.
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.
Re: Reload Stylesheet
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?
I think i need a full reload. Is there a way to get a hold of the function behind "Reload StyleSheet" in Gedi?
-
- Posts: 330
- Joined: Tue Jan 15, 2019 3:12 pm
Re: Reload Stylesheet
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.
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.