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:
@@ -30,7 +30,7 @@
|
||||
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Tools.h>
|
||||
#include <App/Color.h>
|
||||
#include <Base/Color.h>
|
||||
|
||||
#include "PrefWidgets.h"
|
||||
|
||||
@@ -562,12 +562,12 @@ void PrefColorButton::restorePreferences()
|
||||
if (!m_Restored)
|
||||
m_Default = color();
|
||||
|
||||
unsigned int icol = App::Color::asPackedRGBA<QColor>(m_Default);
|
||||
unsigned int icol = Base::Color::asPackedRGBA<QColor>(m_Default);
|
||||
|
||||
unsigned long lcol = static_cast<unsigned long>(icol);
|
||||
lcol = getWindowParameter()->GetUnsigned(entryName(), lcol);
|
||||
icol = static_cast<unsigned int>(lcol);
|
||||
QColor value = App::Color::fromPackedRGBA<QColor>(icol);
|
||||
QColor value = Base::Color::fromPackedRGBA<QColor>(icol);
|
||||
if (!this->allowTransparency())
|
||||
value.setAlpha(0xff);
|
||||
setColor(value);
|
||||
@@ -583,7 +583,7 @@ void PrefColorButton::savePreferences()
|
||||
|
||||
QColor col = color();
|
||||
// (r,g,b,a) with a = 255 (opaque)
|
||||
unsigned int icol = App::Color::asPackedRGBA<QColor>(col);
|
||||
unsigned int icol = Base::Color::asPackedRGBA<QColor>(col);
|
||||
unsigned long lcol = static_cast<unsigned long>(icol);
|
||||
getWindowParameter()->SetUnsigned( entryName(), lcol );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user