Since some time we have new stylesheets based on style parameters. For
compatibility reasons however old stylesheets were left in the project -
this commit removes them by reapplying the theme if old stylesheet is
detected.
This is a hacky fix for https://github.com/FreeCAD/FreeCAD/issues/23607
Basically after widget is shown or polished we enforce it's minimum size to at
least cover the minimum size hint - something that QSS ignores if min-width is
specified.
For some platforms due to event loop and timer triggering being not
deterministic stylesheets could be loaded before style parameters were
fully loaded. This caused warnings about style parameters to appear
potentially confusing users.
This commit changes the stylesheet loading to happen much earlier in the
process so the stylesheet is applied before theme preselection has
chance to happen.
"Professional CMake" book suggest the following:
"Targets should build successfully with or without compiler support for precompiled headers. It
should be considered an optimization, not a requirement. In particular, do not explicitly include a
precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
generated precompile header on the compiler command line instead. This is more portable across
the major compilers and is likely to be easier to maintain. It will also avoid warnings being
generated from certain code checking tools like iwyu (include what you use)."
Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
At the very end of the startup process, check to see if we are using a
versioned directory from a previous version, or we are not versioned at
all but are using the system's default storage location (that is, not a
custom config path set on the command line, etc.). If so, offer to
migrate the old configration folders into new ones for the current
version.
ThemeSearchPaths option was originally introduced in:
f640562b98 ("Option to opt-out from using a Linux desktop icon theme.", 2020-01-26)
It was set on by default in:
f45a4de3ee ("Gui: Use FreeCAD supplied icons on Linux by default", 2024-06-26)
The key effect of the option is to select the FreeCAD-default icon theme.
The code also unnecessarily resets QIcon::themeSearchPaths,
":\icons" is always included in the default search paths [1],
when when using QAdwaitaDecorations causes window frame control icons
not to be displayed:
(qt.qpa.qadwaitadecorations) Failed to find an svg icon for "window-close-symbolic.svg"
(qt.qpa.qadwaitadecorations) Failed to find an svg icon for "window-minimize-symbolic.svg"
(qt.qpa.qadwaitadecorations) Failed to find an svg icon for "window-maximize-symbolic.svg"
(qt.qpa.qadwaitadecorations) Failed to find an svg icon for "window-restore-symbolic.svg"
A different default icon theme can still be chosen with the Name option.
[1] https://doc.qt.io/qt-6/qicon.html#themeSearchPaths
The explicit activation of the MaterialWorkbench breaks the toolbars layout for every start. When fixing it manually it will be broken
again after the next start.
Because the core doesn't depend on the Material module it's a no-go to add an explicit runtime dependency to the corresponding workbench.
Since the Part module depends on the Materials module and the PartGui on MatGui the correct way is to let Part an PartGui load their
dependencies.
Uses new material system for appearance
Each feature object now has a property called ShapeMaterial that
describes its physical properties. If it has a shape, it has a
material.
The ShapeColor attribute is replaced by a ShapeAppearance attribute.
This is a material list that describes all appearance properties, not
just diffuse color. As a list in can be used for all elements of a
shape, such as edges and faces.
A new widget is provided to allow the user to select materials in a
consistent fashion. It can also launch the material editor with its
more advanced capabilities.