13.19f: review 3's scope; the tab strip's other-tab guard and the divider's second press pinned

This commit is contained in:
ZacharyZhang-NY committed 2026-10-03 20:46:39 -04:00
1 parent 1de10e711c
commit 28f6337d13
4 files changed
+37 -5

No files matched your search

+6 -2
View File
@@ -377,8 +377,12 @@ void CameraRawCurveGraphTests::aDoubleClickInTheStripMovesADivider()
Graph graph;
const int w = graph.graph->width(), h = graph.graph->height();
graph.set([](CameraRawCurveSettings &curve) { curve.rgb = {{0, 0}, {0.5, 0.5}, {1, 1}}; });
// Both presses take the nearest divider there; no point goes.
QTest::mouseDClick(graph.graph->window()->windowHandle(), Qt::LeftButton, {}, graph.graph->mapTo(graph.graph->window(), QPoint(int(0.3 * w), h - 5)));
// The first press moves the divider; no point goes.
graph.press(QPoint(int(0.25 * w), h - 5));
graph.release(QPoint(int(0.25 * w), h - 5));
QVERIFY(std::abs(graph.curve().shadowSplit - 25) < 0.5);
// The second press, elsewhere, moves it again.
QTest::mouseDClick(graph.graph, Qt::LeftButton, {}, QPoint(int(0.3 * w), h - 5));
QVERIFY(std::abs(graph.curve().shadowSplit - 30) < 0.5);
QVERIFY(graph.curve().darkSplit == 50 && graph.curve().lightSplit == 75);
QCOMPARE(graph.curve().rgb.size(), size_t(3));
+25
View File
@@ -71,6 +71,7 @@ private slots:
void aBusyProjectHoldsTheOrder();
void aTabClosedMidDragEndsIt();
void aLostReleaseGivesWayToTheNextDrag();
void anotherTabPressedBeforeTheWatchMovesNothing();
void tabsThatDoNotFitGatherInAMenu();
void theMenuSwitchesAndPinsTheChosenTab();
void aBusyProjectOpensNoMenu();
@@ -238,6 +239,30 @@ void ProjectTabDragTests::aLostReleaseGivesWayToTheNextDrag()
QCOMPARE(titles(fixture.workspace), (QStringList{"Untitled 3", "Untitled", "Untitled 2"}));
}
void ProjectTabDragTests::anotherTabPressedBeforeTheWatchMovesNothing()
{
Strip fixture;
const QPoint first = fixture.press("Untitled");
fixture.move(first + QPoint(5000, 0));
const int held = button(fixture.strip, "Untitled").x();
QVERIFY(held > 100);
QDialog alert;
alert.setModal(true);
alert.show();
QVERIFY(QTest::qWaitForWindowExposed(&alert));
fixture.release("Untitled", first + QPoint(5000, 0));
alert.close();
// Pressed before the watch looks: the first drag holds.
const QPoint next = fixture.press("Untitled 2");
fixture.move(next - QPoint(5000, 0));
QCOMPARE(button(fixture.strip, "Untitled").x(), held);
// Its release ends the first drag, which moved nothing.
fixture.release("Untitled 2", next - QPoint(5000, 0));
QTRY_VERIFY(settled(fixture.strip));
QCOMPARE(button(fixture.strip, "Untitled").x(), 0);
QCOMPARE(titles(fixture.workspace), (QStringList{"Untitled", "Untitled 2", "Untitled 3"}));
}
void ProjectTabDragTests::tabsThatDoNotFitGatherInAMenu()
{
Strip fixture(12, 400);