Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
I would like to share with you some QT stylesheets specially "baked" for use in FreeCAD. I have been developing them in the last two weeks without prior knowledge of QT styling, it was kind of a luck that QT is pretty similar to CSS which I master from sometime ago. Anyway it was hard to figure out the subcontrols, rules and specific stuff of QT so don't blame on me if it's not fully depurated. I have uploaded all of them to Github so that you have the opportunity to fork, pull requests or whatever.
They are 2 base stylesheets, Dark and Light, with 3 variations each (green, blue and orange). It's really easy to change colors if you know a little bit of CSS.
freecad_stylesheets-blue.png (291.37 KiB) Viewed 18328 times
freecad_stylesheets-green.png (293.34 KiB) Viewed 18328 times
freecad_stylesheets-orange.png (293.47 KiB) Viewed 18328 times
I have tested them on OSX, Windows and Ubuntu so they should work on any OS, anyway, let me know if you find glitches.
Some comments about FreeCAD and theming:
Images inside stylesheets are forced to use full paths in order to work, that means all these .qss files should be edited per user and computer. I hope FreeCAD developers make a workaround about it.
the "Task panel" is not stylable right now (FreeCAD 0.15) but, thanks to the help of wmayer, it will be on FreeCAD 0.16. You can test it with wmayer-qsint development branch and with these stylesheets. Bugs and more info here
in app icons-buttons are designed in svg but are not stylable, that is, it's not possible to change them... I hope it also changes in the near future
I only found a bug when styling: in OSX, height and width in "QMainWindow::separator:horizontal" and "QMainWindow::separator:vertical" produces a weird line when moving the separators. I think it's a problem of FreeCAD and not from the stylesheets.
Great work. Nice to see that somebody works on this as there are really not so many stylesheets out there.
Images inside stylesheets are forced to use full paths in order to work, that means all these .qss files should be edited per user and computer.
Can you give an example?
the "Task panel" is not stylable right now (stable FreeCAD 0.15), I hope it changes in the near future
The task panel classes is 3rd party code and unfortunately the widget classes override the paintEvent() method in a way that makes it incompatible to stylesheets.
in app icons-buttons are designed in svg but are not stylable, that is, it's not possible to change them... I hope it also changes in the near future
I only found a bug when styling: in OSX, height and width in "QMainWindow::separator:horizontal" and "QMainWindow::separator:vertical" produces a weird line when moving the separators. I think it's a problem of FreeCAD and not from the stylesheets.
If this only happens on OSX it's rather a bug in Qt then.
Images inside stylesheets are forced to use full paths in order to work, that means all these .qss files should be edited per user and computer.
Can you give an example?
If you try relative paths they just don't work (I guess relative paths should "start" from the .qss file itself), a simple example (none of them work):
the "Task panel" is not stylable right now (stable FreeCAD 0.15), I hope it changes in the near future
The task panel classes is 3rd party code and unfortunately the widget classes override the paintEvent() method in a way that makes it incompatible to stylesheets.
I suggested adding to this 3rd party code IDs or classes so that it's possible to reach them with stylesheets... would it be possible?
in app icons-buttons are designed in svg but are not stylable, that is, it's not possible to change them... I hope it also changes in the near future
I only found a bug when styling: in OSX, height and width in "QMainWindow::separator:horizontal" and "QMainWindow::separator:vertical" produces a weird line when moving the separators. I think it's a problem of FreeCAD and not from the stylesheets.
If this only happens on OSX it's rather a bug in Qt then.
I could be... I'm not expert on coding or QT so I just pointed it out: if I comment "width: 4px;" it works properly but do not shows the background because it has not width enough to see it...
rockn wrote:Nice work ! You solve a recurrent problem with the Draft Snap tool button, now they look more easy to distinguish active/deactive. I will test that !
Yes, it took some time to figure it out but now they are partially independent from the rest of tool buttons
=)
nice work and good to know that there is somebody to ask qt style questions ,
i will integrate them to my pluginloader
and hope to get them installable with a macro dialog.
microelly2 wrote:nice work and good to know that there is somebody to ask qt style questions ,
i will integrate them to my pluginloader
and hope to get them installable with a macro dialog.
Looks good. Maybe in the future as there is an option for this available in the preferences one or two alternative style sheets could be available in FreeCAD by default.
If you try relative paths they just don't work (I guess relative paths should "start" from the .qss file itself), a simple example (none of them work):
Relative paths cannot work because the Qt API doesn't accept a file path but only the content of this file. So, the images are only considered relative to the cwd. But if you e.g. change the cwd with