From 9840784272b8ad1e44dc98e75081a964b63281d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hubi=C4=8Dka?= <46065755+janhubicka@users.noreply.github.com> Date: Wed, 23 Sep 2026 21:00:56 +0200 Subject: [PATCH] qtgui: expose Reset for Geometry numeric controls Finish the small safe Geometry portion of the Phase C default/modified-state rollout. Opt Lens center distance and Final rotation into ParameterPanel's real-default presentation. Lens center distance retains its explicit 0 = Auto special value, which is also the real ParameterState default; Final rotation resets to the fresh-state orientation default. Both remain separate undoable reset gestures. Do not add Reset to scanner geometry enums, fit-request toggles, nonlinear session state, or fitted lens/tilt results; those are discrete/calibration semantics already handled by their dedicated controls. Extend workspace churn to require default/reset metadata for both migrated Geometry keys. --- src/qtgui/GeometryPanel.cpp | 4 ++-- src/qtgui/WorkspaceChurnSmoke.cpp | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/qtgui/GeometryPanel.cpp b/src/qtgui/GeometryPanel.cpp index 508fa9ba8..b67f46086 100644 --- a/src/qtgui/GeometryPanel.cpp +++ b/src/qtgui/GeometryPanel.cpp @@ -203,7 +203,7 @@ void GeometryPanel::setupUi() { "allows it anywhere inside the image, and values above 1 allow it " "proportionally outside the image. Useful when a scanner image is a " "crop far from the scanner lens optical axis.", - QStringLiteral("geometry.fit.lens_center_distance")); + QStringLiteral("geometry.fit.lens_center_distance"), true); m_lensMessageLabel = new QLabel(); configureDynamicStatusLabel( @@ -259,7 +259,7 @@ void GeometryPanel::setupUi() { "Continuous rotation in degrees in the libcolorscreen final plane. " "Unlike scan rotation this is not restricted to 90-degree steps and is " "saved in the parameter file.", - QStringLiteral("geometry.final.rotation")); + QStringLiteral("geometry.final.rotation"), true); QCheckBox *finalMirrorCheck = addCheckboxParameter( "Mirror final image", [](const ParameterState &s) { return s.scrToImg.final_mirror; }, diff --git a/src/qtgui/WorkspaceChurnSmoke.cpp b/src/qtgui/WorkspaceChurnSmoke.cpp index 825821e4a..c6e238642 100644 --- a/src/qtgui/WorkspaceChurnSmoke.cpp +++ b/src/qtgui/WorkspaceChurnSmoke.cpp @@ -787,6 +787,18 @@ if (!workflowSummary || !workflowToggle || !workflowStages || "Geometry stable keys crossed the document/UI-state boundary")); return; } + const QStringList geometryDefaultKeys = { + QStringLiteral("geometry.fit.lens_center_distance"), + QStringLiteral("geometry.final.rotation")}; + for (const QString &key : geometryDefaultKeys) { + QToolButton *reset = findParameterResetButton(key); + if (!reset || !reset->property("parameterDefaultValue").isValid()) { + fail(QStringLiteral( + "Workspace churn lost Geometry default/reset metadata for %1") + .arg(key)); + return; + } + } // Image Layer is another complete stable-key panel. Its source choice // and RGB-mix values are saved ParameterState; the three area/channel