Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/qtgui/TilesPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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, "", "",
Expand Down Expand Up @@ -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() {
Expand Down
40 changes: 39 additions & 1 deletion src/qtgui/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<QToolButton *>()) {
if (button->property("sectionKey").toString() ==
QStringLiteral("tiles.adjustments")) {
if (tileAdjustmentsToggle)
return fail("duplicate Tile adjustments section key");
tileAdjustmentsToggle = button;
}
}
for (QGroupBox *group : tiles.findChildren<QGroupBox *>()) {
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() !=
Expand All @@ -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<colorscreen::luminosity_t>(
Expand Down
Loading