Need Help on populating user colors with Stylesheet change.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Need Help on populating user colors with Stylesheet change.
I'm not sure it would qualify as a 'theme' per-se, but what about also having an option to save interface element layout? IE which tool bars/panels are enabled along with relative positioning.
Would doing something like that make sense or even be practical?
Would doing something like that make sense or even be practical?
Re: Need Help on populating user colors with Stylesheet change.
It's completely practical, insofar as all of that information is stored as a user preference. Themes can technically store anything that's in user.cfg (even non-user-interface elements, if you really wanted to). To enable it either the theme author would have to manually add those items to the theme's CFG file, or we'd have to add a template for "UI layout" or something, the way I've proposed we have templates for color and font information.
Re: Need Help on populating user colors with Stylesheet change.
Maybe an off-topic or not...
A list of themes at Freecad start are useful, like templates to start Freecad in different scenarios.
a template for work in inches
a template to work in mm
a template to work mechanical objects
a template to work architecture
.......
......
A list of themes at Freecad start are useful, like templates to start Freecad in different scenarios.
a template for work in inches
a template to work in mm
a template to work mechanical objects
a template to work architecture
.......
......
Re: Need Help on populating user colors with Stylesheet change.
The basic architecture of the Theme Manager supports that kind of use: in an abstract sense, a theme is just a collection of user preferences that can be applied together as a set. The first way this will get exposed to end users right now is via the "Theme" preference that allows them to apply sets of visual customizations. But the same code can potentially be used elsewhere to create other types of preferences sets.
Re: Need Help on populating user colors with Stylesheet change.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: Need Help on populating user colors with Stylesheet change.
Hey, thanks for tagging me in! This is a very interesting development, I'm happy to see this in progress already.
The code I wrote is very crude, it literally finds lines in the user.cfg file and replaces (or appends new lines) as necessary. The app had to be external, because I needed to access the Windows Registry where some of the QT information is stored.
I also planned on making an app that could extract the User colour information in separate xml files and load them back in, but it was more of a workaround to the current process than an actual improvement to the software.
Glad you guys are pushing this forwards the proper way!
Re: Need Help on populating user colors with Stylesheet change.
My Development machine is still dead in the water with all the chip shortages but when you get something I can populate let me know. That way I can find if anything is missing.chennes wrote: ↑Tue Apr 20, 2021 3:53 pm To enable this, we need "template" *.cfg files, listing out the things that get saved in the theme: in the above example, there are a whole bunch of templates, which get read in and presented to the user as checkable boxes. All of this is pretty straightforward. And for external workbenches, the storage location of those cfg files is obvious. But what about for internal stuff? Where should those configuration template files go?
Re: Need Help on populating user colors with Stylesheet change.
The list I posted here: https://forum.freecadweb.org/viewtopic. ... 30#p497808 is what I am using right now, though I have since broken it up into multiple files so the user can choose subsets to save when using the "Save as theme..." option, but those are the options I have right now. I should be able to commit the real files sometime today, but I have to do some actual work here at the office for a bit, and one of the metadata constructors is giving me grief.
Re: Need Help on populating user colors with Stylesheet change.
OK, I got the Theme template reader working now. You can see the templates in:
https://github.com/chennes/FreeCAD/tree ... eTemplates
ETA: I should also note that Mod authors can include theme templates in their mods and they'll be listed in the GUI when the user goes to save a new theme. Any file in a mod subdirectory that ends in "_theme_template.cfg" will be found automatically, and all of those preferences sets will get listed in their own sub-tree, like this:
https://github.com/chennes/FreeCAD/tree ... eTemplates
ETA: I should also note that Mod authors can include theme templates in their mods and they'll be listed in the GUI when the user goes to save a new theme. Any file in a mod subdirectory that ends in "_theme_template.cfg" will be found automatically, and all of those preferences sets will get listed in their own sub-tree, like this:
Re: Need Help on populating user colors with Stylesheet change.
Sounds great. Is the file name pattern hardcoded or referenced from the metadata? There is no problem if is hardcoded but it should be documented somewhere.
Anything referenced in metadata can be indexed and displayed in extension managers before install. While file name conventions require deep search into the extension package once installed. I don't know if it is important in this case, but just to take into account.