Merge pull request #20165 from PaddleStroke/patch-16

Sketcher: Add parameter to combine line and polyline
This commit is contained in:
Chris Hennes
2025-03-16 23:58:07 -05:00
committed by GitHub
3 changed files with 35 additions and 2 deletions

View File

@@ -111,6 +111,7 @@ void SketcherSettings::saveSettings()
ui->checkBoxAutoRemoveRedundants->onSave();
ui->checkBoxUnifiedCoincident->onSave();
ui->checkBoxHorVerAuto->onSave();
ui->checkBoxLineGroup->onSave();
ui->checkBoxAddExtGeo->onSave();
enum
@@ -186,6 +187,8 @@ void SketcherSettings::loadSettings()
ui->checkBoxHorVerAuto->onRestore();
setProperty("checkBoxHorVerAuto", ui->checkBoxHorVerAuto->isChecked());
ui->checkBoxAddExtGeo->onRestore();
setProperty("checkBoxLineGroup", ui->checkBoxLineGroup->isChecked());
ui->checkBoxAddExtGeo->onRestore();
// Dimensioning constraints mode
ui->dimensioningMode->clear();
@@ -246,6 +249,9 @@ void SketcherSettings::checkForRestart()
if (property("checkBoxHorVerAuto").toBool() != ui->checkBoxHorVerAuto->isChecked()) {
SketcherSettings::requireRestart();
}
if (property("checkBoxLineGroup").toBool() != ui->checkBoxLineGroup->isChecked()) {
SketcherSettings::requireRestart();
}
}
/**

View File

@@ -197,6 +197,25 @@ Requires to re-enter edit mode to take effect.</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefCheckBox" name="checkBoxLineGroup">
<property name="toolTip">
<string>If checked, show a command group button that contains both the polyline and line commands. Otherwise, each command has its own separate button.</string>
</property>
<property name="text">
<string>Group the polyline and line commands</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>UnifiedLineCommands</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Sketcher/Commands</cstring>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefCheckBox" name="checkBoxAddExtGeo">
<property name="toolTip">

View File

@@ -298,8 +298,16 @@ inline void SketcherAddWorkspaceLines<Gui::MenuItem>(Gui::MenuItem& geom)
template<>
inline void SketcherAddWorkspaceLines<Gui::ToolBarItem>(Gui::ToolBarItem& geom)
{
geom << "Sketcher_CreatePolyline"
<< "Sketcher_CreateLine";
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath(
"User parameter:BaseApp/Preferences/Mod/Sketcher/Commands");
if (hGrp->GetBool("UnifiedLineCommands", false)) {
geom << "Sketcher_CompLine";
}
else {
geom << "Sketcher_CreatePolyline"
<< "Sketcher_CreateLine";
}
}
template<typename T>