Sketcher: Constraint symbol size follow-up (#23590)

* Sketcher: Constraint symbol size follow-up

* Update SketcherSettings.cpp

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update SketcherSettingsDisplay.ui

* Update EditModeCoinManager.cpp

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove enabled property

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
PaddleStroke
2025-09-09 01:00:26 +02:00
committed by GitHub
parent 50865e3ee9
commit dc22fb4b9b
3 changed files with 5 additions and 25 deletions

View File

@@ -374,7 +374,6 @@ void EditModeCoinManager::ParameterObserver::updateElementSizeParameters(
int sketcherfontSize = hGrp->GetInt("EditSketcherFontSize", defaultFontSizePixels);
int constraintSymbolSizePref = hGrp->GetInt("ConstraintSymbolSize", defaultFontSizePixels);
bool useConstraintSymbolSize = hGrp->GetBool("UseConstraintSymbolSize", false);
double dpi = Client.getApplicationLogicalDPIX();
double devicePixelRatio = Client.getDevicePixelRatio();
@@ -390,12 +389,7 @@ void EditModeCoinManager::ParameterObserver::updateElementSizeParameters(
std::lround(sketcherfontSize * devicePixelRatio); // in pixels (Coin uses pixels)
Client.drawingParameters.labelFontSize = std::lround(
sketcherfontSize * devicePixelRatio * 72.0f / dpi); // in points (SoDatumLabel uses points)
// Constraint icon size: legacy derives 0.8 * font (when override disabled); if override
// enabled we use the stored absolute pixel size (defaulting to full font size initially).
int symbolSizeToUse =
useConstraintSymbolSize ? constraintSymbolSizePref : std::lround(0.8 * sketcherfontSize);
Client.drawingParameters.constraintIconSize = std::lround(symbolSizeToUse * devicePixelRatio);
Client.drawingParameters.constraintIconSize = constraintSymbolSizePref;
auto supportedsizes = Gui::Inventor::MarkerBitmaps::getSupportedSizes("CIRCLE_LINE");
auto scaledMarkerSize = std::lround(markerSize * devicePixelRatio);

View File

@@ -432,7 +432,6 @@ SketcherSettingsDisplay::~SketcherSettingsDisplay()
void SketcherSettingsDisplay::saveSettings()
{
ui->EditSketcherFontSize->onSave();
ui->checkBoxUseConstraintSymbolSize->onSave();
ui->ConstraintSymbolSize->onSave();
ui->viewScalingFactor->onSave();
ui->SegmentsPerGeometry->onSave();
@@ -455,7 +454,6 @@ void SketcherSettingsDisplay::saveSettings()
void SketcherSettingsDisplay::loadSettings()
{
ui->EditSketcherFontSize->onRestore();
ui->checkBoxUseConstraintSymbolSize->onRestore();
ui->ConstraintSymbolSize->onRestore();
ui->viewScalingFactor->onRestore();
ui->SegmentsPerGeometry->onRestore();

View File

@@ -22,21 +22,12 @@
<layout class="QGridLayout" name="gridLayout_1">
<!-- Constraint symbol size -->
<item row="1" column="0">
<widget class="Gui::PrefCheckBox" name="checkBoxUseConstraintSymbolSize">
<property name="toolTip">
<string>Enable a custom pixel size for constraint symbols (otherwise the font size is used).</string>
</property>
<widget class="QLabel" name="label_ConstraintSymbolSize">
<property name="text">
<string>Use custom constraint symbol size</string>
<string>Constraint symbol size</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>UseConstraintSymbolSize</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
<property name="buddy">
<cstring>ConstraintSymbolSize</cstring>
</property>
</widget>
</item>
@@ -57,9 +48,6 @@
<property name="value">
<number>15</number>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>ConstraintSymbolSize</cstring>
</property>