| 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 | |
| 232 | class Content : public Ui::RpWidget { |
| 233 | public: |
no test coverage detected