Add preference for Template edit dot size

This commit is contained in:
WandererFan
2017-08-25 20:23:22 -04:00
committed by wmayer
parent 1722d1cd7d
commit 9379574016
3 changed files with 28 additions and 3 deletions

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>558</width>
<height>709</height>
<height>742</height>
</rect>
</property>
<property name="windowTitle">
@@ -147,6 +147,26 @@
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="lbl_TemplateDot">
<property name="text">
<string>Template Dot Size</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="Gui::PrefDoubleSpinBox" name="dsb_TemplateDot">
<property name="value">
<double>3.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>TemplateDotSize</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/General</cstring>
</property>
</widget>
</item>
</layout>
</item>
<item>

View File

@@ -47,6 +47,7 @@ void DlgPrefsTechDrawImp::saveSettings()
cb_Angle->onSave();
cb_Faces->onSave();
cb_SectionEdges->onSave();
dsb_TemplateDot->onSave();
pcb_Normal->onSave();
pcb_Select->onSave();
@@ -72,6 +73,7 @@ void DlgPrefsTechDrawImp::loadSettings()
cb_Angle->onRestore();
cb_Faces->onRestore();
cb_SectionEdges->onRestore();
dsb_TemplateDot->onRestore();
pcb_Normal->onRestore();
pcb_Select->onRestore();

View File

@@ -180,6 +180,10 @@ void QGISVGTemplate::createClickHandles(void)
//TODO: Find location of special fields (first/third angle) and make graphics items for them
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
double dotSize = hGrp->GetFloat("TemplateDotSize", 3.0);
while (boost::regex_search(begin, end, tagMatch, tagRegex)) {
if ( boost::regex_search(tagMatch[1].first, tagMatch[1].second, nameMatch, editableNameRegex) &&
boost::regex_search(tagMatch[1].first, tagMatch[1].second, xMatch, xRegex) &&
@@ -191,8 +195,7 @@ void QGISVGTemplate::createClickHandles(void)
double x = Rez::guiX(xStr.toDouble());
double y = Rez::guiX(yStr.toDouble());
//TODO: this should probably be configurable without a code change
double editClickBoxSize = Rez::guiX(1.5);
double editClickBoxSize = Rez::guiX(dotSize);
QColor editClickBoxColor = Qt::green;
double width = editClickBoxSize;