From dc22fb4b9be59cc60b1763ece369467291cb9ddd Mon Sep 17 00:00:00 2001 From: PaddleStroke Date: Tue, 9 Sep 2025 01:00:26 +0200 Subject: [PATCH] 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> --- src/Mod/Sketcher/Gui/EditModeCoinManager.cpp | 8 +------- src/Mod/Sketcher/Gui/SketcherSettings.cpp | 2 -- .../Sketcher/Gui/SketcherSettingsDisplay.ui | 20 ++++--------------- 3 files changed, 5 insertions(+), 25 deletions(-) diff --git a/src/Mod/Sketcher/Gui/EditModeCoinManager.cpp b/src/Mod/Sketcher/Gui/EditModeCoinManager.cpp index a90abfc0bf..53f4630bf8 100644 --- a/src/Mod/Sketcher/Gui/EditModeCoinManager.cpp +++ b/src/Mod/Sketcher/Gui/EditModeCoinManager.cpp @@ -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); diff --git a/src/Mod/Sketcher/Gui/SketcherSettings.cpp b/src/Mod/Sketcher/Gui/SketcherSettings.cpp index cb81f2978c..0718020718 100644 --- a/src/Mod/Sketcher/Gui/SketcherSettings.cpp +++ b/src/Mod/Sketcher/Gui/SketcherSettings.cpp @@ -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(); diff --git a/src/Mod/Sketcher/Gui/SketcherSettingsDisplay.ui b/src/Mod/Sketcher/Gui/SketcherSettingsDisplay.ui index c048cbc384..530879e042 100644 --- a/src/Mod/Sketcher/Gui/SketcherSettingsDisplay.ui +++ b/src/Mod/Sketcher/Gui/SketcherSettingsDisplay.ui @@ -22,21 +22,12 @@ - - - Enable a custom pixel size for constraint symbols (otherwise the font size is used). - + - Use custom constraint symbol size + Constraint symbol size - - false - - - UseConstraintSymbolSize - - - View + + ConstraintSymbolSize @@ -57,9 +48,6 @@ 15 - - false - ConstraintSymbolSize