| 1310 | } |
| 1311 | |
| 1312 | void Widget::setupShortcuts(not_null<Window::SessionController *> controller) { |
| 1313 | Shortcuts::Requests( |
| 1314 | ) | rpl::filter([=] { |
| 1315 | return isActiveWindow() |
| 1316 | && !controller->isLayerShown() |
| 1317 | && !controller->window().locked(); |
| 1318 | }) | rpl::on_next([=](not_null<Shortcuts::Request*> request) { |
| 1319 | using Command = Shortcuts::Command; |
| 1320 | |
| 1321 | request->check(Command::GlobalSearch) && request->handle([=] { |
| 1322 | if (_openedFolder) { |
| 1323 | controller->closeFolder(); |
| 1324 | setInnerFocus(); |
| 1325 | return true; |
| 1326 | } else { |
| 1327 | if (controller->adaptive().isOneColumn()) { |
| 1328 | controller->clearSectionStack(); |
| 1329 | controller->showBackFromStack(); |
| 1330 | } else { |
| 1331 | setInnerFocus(); |
| 1332 | } |
| 1333 | return true; |
| 1334 | } |
| 1335 | return false; |
| 1336 | }); |
| 1337 | }, lifetime()); |
| 1338 | } |
| 1339 | |
| 1340 | void Widget::updateScrollUpVisibility() { |
| 1341 | if (_scrollToAnimation.animating()) { |
nothing calls this directly
no test coverage detected