+ fixes #0001393: Allow the user to set desired font size in pixels (used by sketcher constraints) in preferences

This commit is contained in:
wmayer 2014-03-09 18:29:26 +01:00
parent 2aaa63c5eb
commit b68bb653c8
3 changed files with 75 additions and 5 deletions

View File

@ -66,6 +66,9 @@ void SketcherSettings::saveSettings()
ui->DefaultSketcherLineWidth->onSave();
ui->CursorTextColor->onSave();
// Sketch editing
ui->EditSketcherFontSize->onSave();
}
void SketcherSettings::loadSettings()
@ -86,6 +89,9 @@ void SketcherSettings::loadSettings()
ui->DefaultSketcherLineWidth->onRestore();
ui->CursorTextColor->onRestore();
// Sketch editing
ui->EditSketcherFontSize->onRestore();
}
/**

View File

@ -7,14 +7,14 @@
<x>0</x>
<y>0</y>
<width>359</width>
<height>834</height>
<height>544</height>
</rect>
</property>
<property name="windowTitle">
<string>Sketcher</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBoxSketcherColor">
<property name="title">
<string>Sketcher colors</string>
@ -439,7 +439,68 @@
</layout>
</widget>
</item>
<item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Sketch editing</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_6">
<property name="minimumSize">
<size>
<width>182</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Font size</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefSpinBox" name="EditSketcherFontSize">
<property name="suffix">
<string>px</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>17</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>EditSketcherFontSize</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>71</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>

View File

@ -2738,6 +2738,9 @@ void ViewProviderSketch::rebuildConstraintsVisual(void)
edit->constrGroup->removeAllChildren();
edit->vConstrType.clear();
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View");
int fontSize = hGrp->GetInt("EditSketcherFontSize", 17);
for (std::vector<Sketcher::Constraint *>::const_iterator it=constrlist.begin(); it != constrlist.end(); ++it) {
// root separator for one constraint
SoSeparator *sep = new SoSeparator();
@ -2772,7 +2775,7 @@ void ViewProviderSketch::rebuildConstraintsVisual(void)
text->norm.setValue(norm);
text->string = "";
text->textColor = ConstrDimColor;
text->size.setValue(17);
text->size.setValue(fontSize);
text->useAntialiasing = false;
SoAnnotation *anno = new SoAnnotation();
anno->renderCaching = SoSeparator::OFF;