diff --git a/src/qtgui/TilesPanel.cpp b/src/qtgui/TilesPanel.cpp index 67fe13f1..6c6850f3 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 552df030..37f44b43 100644 --- a/src/qtgui/main.cpp +++ b/src/qtgui/main.cpp @@ -1477,8 +1477,27 @@ bool runBetaInvariantSmoke() { findTileSpin(QStringLiteral("tiles.0.0.exposure")); 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")) { + if (tileAdjustmentsToggle) + return fail("duplicate Tile adjustments section key"); + 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 || + !exposure || !darkPoint || !tileAdjustmentsToggle || + !tileAdjustmentsGroup || tile0Enabled->property("parameterKey").toString() != QStringLiteral("tiles.0.0.enabled") || tile1Enabled->property("parameterKey").toString() != @@ -1487,6 +1506,25 @@ 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->isVisibleTo(tileAdjustmentsGroup) || + !darkPoint->isVisibleTo(tileAdjustmentsGroup) || + tile0Selector->isHidden()) + return fail("expanded Tile adjustments did not expose its editors"); + tileAdjustmentsToggle->setChecked(false); + tiles.updateUI(); + if (exposure->isVisibleTo(tileAdjustmentsGroup) || + darkPoint->isVisibleTo(tileAdjustmentsGroup) || + 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(