Base: Move App::Color to Base
Every basic data type is stored in Base module, color is standing out as one that does not. Moving it to Base opens possibilities to integrate it better with the rest of FreeCAD.
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "Mod/Sketcher/App/ExternalGeometryFacade.h"
|
||||
|
||||
#include <App/Color.h>
|
||||
#include <Base/Color.h>
|
||||
#include <Gui/ViewParams.h>
|
||||
|
||||
#include "EditModeCoinManagerParameters.h"
|
||||
@@ -59,10 +59,10 @@ SbColor DrawingParameters::CreateCurveColor(0.5f, 0.5f, 0.5f); // ##7f7f7f -> (
|
||||
namespace
|
||||
{ // Anonymous namespace to avoid making those variables global
|
||||
unsigned long HColorLong = Gui::ViewParams::instance()->getAxisXColor();
|
||||
App::Color Hcolor = App::Color(static_cast<uint32_t>(HColorLong));
|
||||
Base::Color Hcolor = Base::Color(static_cast<uint32_t>(HColorLong));
|
||||
|
||||
unsigned long VColorLong = Gui::ViewParams::instance()->getAxisYColor();
|
||||
App::Color Vcolor = App::Color(static_cast<uint32_t>(VColorLong));
|
||||
Base::Color Vcolor = Base::Color(static_cast<uint32_t>(VColorLong));
|
||||
} // namespace
|
||||
SbColor DrawingParameters::CrossColorH(Hcolor.r, Hcolor.g, Hcolor.b);
|
||||
SbColor DrawingParameters::CrossColorV(Vcolor.r, Vcolor.g, Vcolor.b);
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include <Inventor/nodes/SoText2.h>
|
||||
#include <Inventor/nodes/SoTranslation.h>
|
||||
|
||||
#include <App/Color.h>
|
||||
#include <Base/Color.h>
|
||||
#include <Gui/ViewParams.h>
|
||||
#include <Gui/Inventor/SmSwitchboard.h>
|
||||
#include <Mod/Sketcher/App/GeoList.h>
|
||||
@@ -153,14 +153,14 @@ struct DrawingParameters
|
||||
DrawingParameters()
|
||||
{
|
||||
unsigned long colorLong;
|
||||
App::Color color;
|
||||
Base::Color color;
|
||||
|
||||
colorLong = Gui::ViewParams::instance()->getAxisXColor();
|
||||
color = App::Color(static_cast<uint32_t>(colorLong));
|
||||
color = Base::Color(static_cast<uint32_t>(colorLong));
|
||||
CrossColorH = SbColor(color.r, color.g, color.b);
|
||||
|
||||
colorLong = Gui::ViewParams::instance()->getAxisYColor();
|
||||
color = App::Color(static_cast<uint32_t>(colorLong));
|
||||
color = Base::Color(static_cast<uint32_t>(colorLong));
|
||||
CrossColorV = SbColor(color.r, color.g, color.b);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -141,7 +141,7 @@ void ViewProviderSketch::ParameterObserver::updateColorProperty(const std::strin
|
||||
|
||||
colorprop->setValue(r, g, b);
|
||||
|
||||
App::Color elementAppColor = colorprop->getValue();
|
||||
Base::Color elementAppColor = colorprop->getValue();
|
||||
unsigned long color = (unsigned long)(elementAppColor.getPackedValue());
|
||||
color = hGrp->GetUnsigned(string.c_str(), color);
|
||||
elementAppColor.setPackedValue((uint32_t)color);
|
||||
@@ -345,7 +345,7 @@ void ViewProviderSketch::ParameterObserver::initParameters()
|
||||
{[this, packedDefaultGridColor](const std::string& string,
|
||||
[[maybe_unused]] App::Property* property) {
|
||||
auto v = getSketcherGeneralParameter(string, packedDefaultGridColor);
|
||||
auto color = App::Color(v);
|
||||
auto color = Base::Color(v);
|
||||
Client.setGridLineColor(color);
|
||||
},
|
||||
nullptr}},
|
||||
@@ -353,7 +353,7 @@ void ViewProviderSketch::ParameterObserver::initParameters()
|
||||
{[this, packedDefaultGridColor](const std::string& string,
|
||||
[[maybe_unused]] App::Property* property) {
|
||||
auto v = getSketcherGeneralParameter(string, packedDefaultGridColor);
|
||||
auto color = App::Color(v);
|
||||
auto color = Base::Color(v);
|
||||
Client.setGridDivLineColor(color);
|
||||
},
|
||||
nullptr}},
|
||||
@@ -2941,7 +2941,7 @@ void SketcherGui::ViewProviderSketch::finishRestoring()
|
||||
// that meaans that we need to run migration strategy and come up with a proper value
|
||||
if (!AutoColor.isTouched()) {
|
||||
// white is the normally provided default for FreeCAD sketch colors
|
||||
auto white = App::Color(1.f, 1.f, 1.f, 1.f);
|
||||
auto white = Base::Color(1.f, 1.f, 1.f, 1.f);
|
||||
|
||||
auto colorWasNeverChanged =
|
||||
LineColor.getValue() == white &&
|
||||
|
||||
Reference in New Issue
Block a user