MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / ForwardListNavigation

Function ForwardListNavigation

Telegram/SourceFiles/boxes/language_box.cpp:212–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210};
211
212[[nodiscard]] bool ForwardListNavigation(
213 not_null<QKeyEvent*> e,
214 not_null<Rows*> rows,
215 int pageHeight) {
216 const auto key = e->key();
217 if (key == Qt::Key_Down) {
218 rows->selectSkip(1);
219 } else if (key == Qt::Key_Up) {
220 rows->selectSkip(-1);
221 } else if (key == Qt::Key_PageDown || key == Qt::Key_PageUp) {
222 const auto perPage = std::max(
223 pageHeight / Rows::DefaultRowHeight(),
224 1);
225 rows->selectSkip((key == Qt::Key_PageDown) ? perPage : -perPage);
226 } else {
227 return false;
228 }
229 return true;
230}
231
232class Content : public Ui::RpWidget {
233public:

Callers 1

keyPressEventMethod · 0.70

Calls 2

keyMethod · 0.45
selectSkipMethod · 0.45

Tested by

no test coverage detected