Numeric keypad spans the full keyboard height
- Sections take "fillHeight": their rows stretch over the whole key area instead of sitting at the bottom at the shared row height - Rows of other blocks are unaffected; the template turns it on for the numpad Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -62,13 +62,26 @@ private Q_SLOTS:
|
||||
|
||||
void blocksShareUnitAndSitAtTheBottom()
|
||||
{
|
||||
const Block tall{{key(), key()}, {key(), key()}};
|
||||
const Block shortBlock{{key()}};
|
||||
const Block tall{{{key(), key()}, {key(), key()}}};
|
||||
const Block shortBlock{{{key()}}};
|
||||
const auto rects = computeKeyRects({tall, shortBlock}, {400, 100}, {.padding = 0, .gap = 0, .blockGap = 100});
|
||||
// 3 units in 300 px: 100 each.
|
||||
QCOMPARE(rects[1].right(), 200.0);
|
||||
QCOMPARE(rects[4], QRectF(300, 50, 100, 50));
|
||||
}
|
||||
|
||||
void fillingBlockSpansTheFullHeight()
|
||||
{
|
||||
const Block tall{{{key()}, {key()}, {key()}, {key()}}};
|
||||
const Block filling{{{key()}, {key()}}, true};
|
||||
const auto rects = computeKeyRects({tall, filling}, {200, 100}, {.padding = 0, .gap = 0, .blockGap = 0});
|
||||
QCOMPARE(rects[0].height(), 25.0);
|
||||
QCOMPARE(rects[4], QRectF(100, 0, 100, 50));
|
||||
QCOMPARE(rects[5], QRectF(100, 50, 100, 50));
|
||||
// A filling block taller than the rest doesn't shrink the shared rows.
|
||||
QCOMPARE(totalRows({tall, filling}), 4);
|
||||
QCOMPARE(totalRows({filling}), 2);
|
||||
}
|
||||
};
|
||||
|
||||
QTEST_GUILESS_MAIN(TestKeyGeometry)
|
||||
|
||||
Reference in New Issue
Block a user