[TD]Default color and weight for markup lines
This commit is contained in:
@@ -481,6 +481,38 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="4">
|
||||
<widget class="QLabel" name="label_17">
|
||||
<property name="font">
|
||||
<font>
|
||||
<italic>true</italic>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Markups</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="6">
|
||||
<widget class="Gui::PrefColorButton" name="pcbMarkup">
|
||||
<property name="toolTip">
|
||||
<string>Default color for annotations </string>
|
||||
</property>
|
||||
<property name="color">
|
||||
<color>
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>Color</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/TechDraw/Markups</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
@@ -74,6 +74,8 @@ void DlgPrefsTechDraw1Imp::saveSettings()
|
||||
pcbSectionLine->onSave();
|
||||
pcbCenterColor->onSave();
|
||||
pcbVertexColor->onSave();
|
||||
|
||||
pcbMarkup->onSave();
|
||||
}
|
||||
|
||||
void DlgPrefsTechDraw1Imp::loadSettings()
|
||||
@@ -108,6 +110,8 @@ void DlgPrefsTechDraw1Imp::loadSettings()
|
||||
pcbSectionLine->onRestore();
|
||||
pcbCenterColor->onRestore();
|
||||
pcbVertexColor->onRestore();
|
||||
|
||||
pcbMarkup->onRestore();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -225,7 +225,9 @@ void TaskLeaderLine::setUiPrimary()
|
||||
|
||||
ui->dsbWeight->setUnit(Base::Unit::Length);
|
||||
ui->dsbWeight->setMinimum(0);
|
||||
ui->dsbWeight->setValue(0.5);
|
||||
ui->dsbWeight->setValue(prefWeight());
|
||||
|
||||
ui->cpLineColor->setColor(prefLineColor().asValue<QColor>());
|
||||
}
|
||||
|
||||
//switch widgets related to ViewProvider on/off
|
||||
@@ -660,6 +662,28 @@ int TaskLeaderLine::getPrefArrowStyle()
|
||||
return style;
|
||||
}
|
||||
|
||||
double TaskLeaderLine::prefWeight() const
|
||||
{
|
||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||
.GetGroup("BaseApp")->GetGroup("Preferences")->
|
||||
GetGroup("Mod/TechDraw/Decorations");
|
||||
std::string lgName = hGrp->GetASCII("LineGroup","FC 0.70mm");
|
||||
auto lg = TechDraw::LineGroup::lineGroupFactory(lgName);
|
||||
double weight = lg->getWeight("Thin");
|
||||
delete lg; //Coverity CID 174670
|
||||
return weight;
|
||||
}
|
||||
|
||||
App::Color TaskLeaderLine::prefLineColor(void)
|
||||
{
|
||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().
|
||||
GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Markups");
|
||||
App::Color result;
|
||||
result.setPackedValue(hGrp->GetUnsigned("Color", 0x00000000));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//******************************************************************************
|
||||
|
||||
bool TaskLeaderLine::accept()
|
||||
|
||||
@@ -113,8 +113,10 @@ protected:
|
||||
void enableVPUi(bool b);
|
||||
void setEditCursor(QCursor c);
|
||||
|
||||
QGIView* findParentQGIV();
|
||||
int getPrefArrowStyle();
|
||||
QGIView* findParentQGIV();
|
||||
int getPrefArrowStyle();
|
||||
double prefWeight() const;
|
||||
App::Color prefLineColor(void);
|
||||
|
||||
void saveState(void);
|
||||
void restoreState(void);
|
||||
|
||||
@@ -198,7 +198,10 @@ void TaskRichAnno::setUiPrimary()
|
||||
}
|
||||
ui->dsbWidth->setUnit(Base::Unit::Length);
|
||||
ui->dsbWidth->setMinimum(0);
|
||||
ui->dsbWidth->setValue(0.5);
|
||||
ui->dsbWidth->setValue(prefWeight());
|
||||
|
||||
ui->cpFrameColor->setColor(prefLineColor().asValue<QColor>());
|
||||
|
||||
}
|
||||
|
||||
void TaskRichAnno::enableTextUi(bool b)
|
||||
@@ -288,6 +291,28 @@ void TaskRichAnno::onEditorExit(void)
|
||||
m_rte = nullptr;
|
||||
}
|
||||
|
||||
double TaskRichAnno::prefWeight() const
|
||||
{
|
||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||
.GetGroup("BaseApp")->GetGroup("Preferences")->
|
||||
GetGroup("Mod/TechDraw/Decorations");
|
||||
std::string lgName = hGrp->GetASCII("LineGroup","FC 0.70mm");
|
||||
auto lg = TechDraw::LineGroup::lineGroupFactory(lgName);
|
||||
double weight = lg->getWeight("Graphic");
|
||||
delete lg; //Coverity CID 174670
|
||||
return weight;
|
||||
}
|
||||
|
||||
App::Color TaskRichAnno::prefLineColor(void)
|
||||
{
|
||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().
|
||||
GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Markups");
|
||||
App::Color result;
|
||||
result.setPackedValue(hGrp->GetUnsigned("Color", 0x00000000));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//******************************************************************************
|
||||
void TaskRichAnno::createAnnoFeature()
|
||||
{
|
||||
|
||||
@@ -99,7 +99,9 @@ protected:
|
||||
void setUiEdit(void);
|
||||
void enableTextUi(bool b);
|
||||
void enableVPUi(bool b);
|
||||
|
||||
double prefWeight() const;
|
||||
App::Color prefLineColor(void);
|
||||
|
||||
private:
|
||||
Ui_TaskRichAnno * ui;
|
||||
bool blockUpdate;
|
||||
|
||||
Reference in New Issue
Block a user