Styling "Tasks" panel
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Styling "Tasks" panel
Hello,
I'm playing around with QT style sheets in order to customize the look of FreeCAD, I'm going pretty good but can't reach the style of the "Tasks" panel and all its children: That is, can't change colors of "create Geometry" title, the icon or even the children...
Any clue on how to reach them?
Thank you
I'm playing around with QT style sheets in order to customize the look of FreeCAD, I'm going pretty good but can't reach the style of the "Tasks" panel and all its children: That is, can't change colors of "create Geometry" title, the icon or even the children...
Any clue on how to reach them?
Thank you
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
Re: Styling "Tasks" panel
I don't know much about Qt stylesheets, but I doubt that widget can be styled much using a stylesheet since the widget uses its own C++ class for defining the style. Anyway, I think the widget selectors would be issTaskPanel (for the background), iisTaskGroup (for the task boxes), and iisTaskHeader (for the box headers).
Re: Styling "Tasks" panel
Thanks peterl94 but it doesn't work... I don't know if the selectors you told me don't work or if I'm styling them incorrectly so at the end I don't reach them. I have tried several combinations bone any of them works...
Could you please write a more precise answer? kind of:
or
Thank you!
Could you please write a more precise answer? kind of:
Code: Select all
issTaskPanel {
background-color: red;
}
Code: Select all
QWidget::issTaskPanel {
background-color: red;
}
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
Re: Styling "Tasks" panel
You tried what I was thinking of. Unfortunately, that means it cannot be styled with a stylesheet. Qt doesn't make it very easy to add stylesheet support to custom painted widgets. Although, I did see an example of how it could be done. I would try implementing it if I had the time...
Re: Styling "Tasks" panel
The iisTaskPanel classes have re-implemented their paintEvent() methods and I guess the way this is done makes it incompatible to the qss framework.
Re: Styling "Tasks" panel
Umm, that's bad news...
I guess it should be modified so that it can be styled...
Maybe just adding "tags" or "IDs" could work... is that possible?
Example:
or
I guess it should be modified so that it can be styled...
Maybe just adding "tags" or "IDs" could work... is that possible?
Example:
Code: Select all
.TaskPanel {
background-color: red;
}
.TaskGroup {
border: 1px solid blue;
}
.TaskHeader {
background-color: green;
}
Code: Select all
#TaskPanel {
background-color: red;
}
#TaskGroup {
border: 1px solid blue;
}
#TaskHeader {
background-color: green;
}
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
Re: Styling "Tasks" panel
One would need to reimplement the custom paint event functions to use the QStyle classes. If one can add custtom tags to the css I'm not sure, I did never dive that deep into the style sheet stuff. Those changes are for sure possible, however, it takes effort. You can open a feature request in the bug tracker. But in FreeCAD the developers do the things they want to do, so there is a rathre big chance that feature will not be done anytime soon. Therefore you should also consider trying to do it yourself and provide the code.I guess it should be modified so that it can be styled...
Maybe just adding "tags" or "IDs" could work... is that possible?
Re: Styling "Tasks" panel
Yeah, you are right... one of the best options is to do it by myself...
At least, do you know where in the code is this class so that I can go directly to the file and study it?
Thanks
At least, do you know where in the code is this class so that I can go directly to the file and study it?
Thanks
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
Re: Styling "Tasks" panel
https://github.com/FreeCAD/FreeCAD_sf_m ... sTaskPanel
that is the place to go. I think every part has a onw class that needs to be altered, e.g. for the background the panel class is relevant.
that is the place to go. I think every part has a onw class that needs to be altered, e.g. for the background the panel class is relevant.
Re: Styling "Tasks" panel
FYI, the iistaskpanel library uses its own kind of styling with the class iisTaskPanelScheme and by sub-classing you can change colors or icons. Maybe this makes it possible to use qss in a certain (and limited) way.