[TD]Centralize preference getters

This commit is contained in:
wandererfan
2020-04-12 20:44:08 -04:00
committed by WandererFan
parent a6cfe5c47f
commit a3029fec74
61 changed files with 881 additions and 501 deletions

View File

@@ -37,10 +37,12 @@
#include <qmath.h>
#include "Rez.h"
#include "DrawGuiUtil.h"
#include "PreferencesGui.h"
#include "QGIView.h"
#include "QGIHighlight.h"
using namespace TechDrawGui;
using namespace TechDraw;
QGIHighlight::QGIHighlight()
{
@@ -175,26 +177,17 @@ void QGIHighlight::setFont(QFont f, double fsize)
QColor QGIHighlight::getHighlightColor()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
App::Color fcColor = App::Color((uint32_t) hGrp->GetUnsigned("SectionColor", 0x08080800));
return fcColor.asValue<QColor>();
return PreferencesGui::sectionLineQColor();
}
Qt::PenStyle QGIHighlight::getHighlightStyle()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
GetGroup("Preferences")->GetGroup("Mod/TechDraw");
Qt::PenStyle sectStyle = static_cast<Qt::PenStyle> (hGrp->GetInt("SectionLine",2));
return sectStyle;
return PreferencesGui::sectionLineStyle();
}
int QGIHighlight::getHoleStyle()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
int style = hGrp->GetInt("MattingStyle", 0);
return style;
return PreferencesGui::mattingStyle();
}
void QGIHighlight::paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget) {