From 054bedf29fc866c6c16355aa1267528899b23569 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 20:52:33 +0200 Subject: [PATCH 1/2] qtgui: remember Tile adjustments folding Finish the Tiles portion of the Phase C section-persistence cleanup. Give the existing Tile adjustments section the stable application-preference key tiles.adjustments and replay presentation state after the shared Exposure/Dark point editors are populated so a restored collapsed preference is correct before the panel is first shown. Extend the existing stitched-tile beta smoke to verify that programmatic folding hides only the shared adjustment editors while the independent tile-selector grid remains visible. Restore the original local fold state after the probe so the smoke does not write or disturb operator preferences. --- src/qtgui/TilesPanel.cpp | 8 +++++++- src/qtgui/main.cpp | 28 +++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/qtgui/TilesPanel.cpp b/src/qtgui/TilesPanel.cpp index 67fe13f1b..6c6850f35 100644 --- a/src/qtgui/TilesPanel.cpp +++ b/src/qtgui/TilesPanel.cpp @@ -35,7 +35,8 @@ void TilesPanel::setupUi() { m_currentGroupForm = nullptr; - addSeparator(tr("Tile adjustments")); + addSeparator(tr("Tile adjustments"), + QStringLiteral("tiles.adjustments")); m_exposureRow = addSliderParameter( tr("Exposure"), 0.01, 10.0, 100, 3, "", "", @@ -92,6 +93,11 @@ void TilesPanel::setupUi() { return tileParameterKey(currentTileX(), currentTileY(), QStringLiteral("dark_point")); }); + + // The adjustment rows are added after the section header. Replay restored + // folding before the panel is first shown so a saved collapsed section + // cannot briefly expose the shared tile editors. + updateUI(); } void TilesPanel::updateForNewImage() { diff --git a/src/qtgui/main.cpp b/src/qtgui/main.cpp index 552df0303..b9d8a9ec2 100644 --- a/src/qtgui/main.cpp +++ b/src/qtgui/main.cpp @@ -1477,8 +1477,17 @@ bool runBetaInvariantSmoke() { findTileSpin(QStringLiteral("tiles.0.0.exposure")); QDoubleSpinBox *darkPoint = findTileSpin(QStringLiteral("tiles.0.0.dark_point")); + QToolButton *tileAdjustmentsToggle = nullptr; + for (QToolButton *button : tiles.findChildren()) { + if (button->property("sectionKey").toString() == + QStringLiteral("tiles.adjustments")) { + if (tileAdjustmentsToggle) + return fail("duplicate Tile adjustments section key"); + tileAdjustmentsToggle = button; + } + } if (!tile0Selector || !tile1Selector || !tile0Enabled || !tile1Enabled || - !exposure || !darkPoint || + !exposure || !darkPoint || !tileAdjustmentsToggle || tile0Enabled->property("parameterKey").toString() != QStringLiteral("tiles.0.0.enabled") || tile1Enabled->property("parameterKey").toString() != @@ -1487,6 +1496,23 @@ bool runBetaInvariantSmoke() { tile1Selector->property("parameterKey").isValid()) return fail("tile keys crossed the document/selection-state boundary"); + // Folding is presentation-only and must own the shared tile editors without + // touching the independent tile-selector grid or document state. + const bool originalTileAdjustmentsExpanded = + tileAdjustmentsToggle->isChecked(); + tileAdjustmentsToggle->setChecked(true); + tiles.updateUI(); + if (exposure->isHidden() || darkPoint->isHidden() || + tile0Selector->isHidden()) + return fail("expanded Tile adjustments did not expose its editors"); + tileAdjustmentsToggle->setChecked(false); + tiles.updateUI(); + if (!exposure->isHidden() || !darkPoint->isHidden() || + tile0Selector->isHidden()) + return fail("collapsed Tile adjustments did not own only its editors"); + tileAdjustmentsToggle->setChecked(originalTileAdjustmentsExpanded); + tiles.updateUI(); + const double tile0Before = exposure->value(); const colorscreen::luminosity_t tile0After = static_cast( From 128c400e16ddd0feea3bb6c24d367ec4977fee9e 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 20:59:17 +0200 Subject: [PATCH 2/2] test: check Tile folding through row ancestry --- src/qtgui/main.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/qtgui/main.cpp b/src/qtgui/main.cpp index b9d8a9ec2..37f44b43c 100644 --- a/src/qtgui/main.cpp +++ b/src/qtgui/main.cpp @@ -1478,6 +1478,7 @@ bool runBetaInvariantSmoke() { QDoubleSpinBox *darkPoint = findTileSpin(QStringLiteral("tiles.0.0.dark_point")); QToolButton *tileAdjustmentsToggle = nullptr; + QGroupBox *tileAdjustmentsGroup = nullptr; for (QToolButton *button : tiles.findChildren()) { if (button->property("sectionKey").toString() == QStringLiteral("tiles.adjustments")) { @@ -1486,8 +1487,17 @@ bool runBetaInvariantSmoke() { tileAdjustmentsToggle = button; } } + for (QGroupBox *group : tiles.findChildren()) { + if (group->property("sectionKey").toString() == + QStringLiteral("tiles.adjustments")) { + if (tileAdjustmentsGroup) + return fail("duplicate Tile adjustments group key"); + tileAdjustmentsGroup = group; + } + } if (!tile0Selector || !tile1Selector || !tile0Enabled || !tile1Enabled || !exposure || !darkPoint || !tileAdjustmentsToggle || + !tileAdjustmentsGroup || tile0Enabled->property("parameterKey").toString() != QStringLiteral("tiles.0.0.enabled") || tile1Enabled->property("parameterKey").toString() != @@ -1502,12 +1512,14 @@ bool runBetaInvariantSmoke() { tileAdjustmentsToggle->isChecked(); tileAdjustmentsToggle->setChecked(true); tiles.updateUI(); - if (exposure->isHidden() || darkPoint->isHidden() || + if (!exposure->isVisibleTo(tileAdjustmentsGroup) || + !darkPoint->isVisibleTo(tileAdjustmentsGroup) || tile0Selector->isHidden()) return fail("expanded Tile adjustments did not expose its editors"); tileAdjustmentsToggle->setChecked(false); tiles.updateUI(); - if (!exposure->isHidden() || !darkPoint->isHidden() || + if (exposure->isVisibleTo(tileAdjustmentsGroup) || + darkPoint->isVisibleTo(tileAdjustmentsGroup) || tile0Selector->isHidden()) return fail("collapsed Tile adjustments did not own only its editors"); tileAdjustmentsToggle->setChecked(originalTileAdjustmentsExpanded);