Optional PC key blocks: function row, navigation, numeric keypad
- Template sections placed above or to the right of the typing keys; the user picks any mix in settings, typing keys included - keysym keys send XKB keysyms on press, optionally repeating - Geometry lays blocks side by side with one key unit; stretch keys are resolved at layout time so composed blocks line up - Toggling a block resizes the window so keys keep their size Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -49,6 +49,26 @@ private Q_SLOTS:
|
||||
QCOMPARE(rects[4].left(), 100.0);
|
||||
QCOMPARE(rects[5].right(), 300.0);
|
||||
}
|
||||
|
||||
void stretchKeysFillTheRow()
|
||||
{
|
||||
KeyDef wide = key();
|
||||
wide.stretch = true;
|
||||
const Layer layer{u"l"_s, {{key(), key(), key(), key()}, {key(), wide}}};
|
||||
const auto rects = computeKeyRects(layer, {400, 100}, {.padding = 0, .gap = 0});
|
||||
QCOMPARE(rects[4].left(), 0.0);
|
||||
QCOMPARE(rects[5].width(), 300.0);
|
||||
}
|
||||
|
||||
void blocksShareUnitAndSitAtTheBottom()
|
||||
{
|
||||
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));
|
||||
}
|
||||
};
|
||||
|
||||
QTEST_GUILESS_MAIN(TestKeyGeometry)
|
||||
|
||||
Reference in New Issue
Block a user