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

Method setupShortcuts

Telegram/SourceFiles/dialogs/dialogs_widget.cpp:1312–1338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1310}
1311
1312void 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
1340void Widget::updateScrollUpVisibility() {
1341 if (_scrollToAnimation.animating()) {

Callers

nothing calls this directly

Calls 15

RequestsFunction · 0.85
ActivateWindowFunction · 0.85
handleMethod · 0.80
closeFolderMethod · 0.80
clearSectionStackMethod · 0.80
activeChatCurrentMethod · 0.80
isLayerShownMethod · 0.45
lockedMethod · 0.45
windowMethod · 0.45
checkMethod · 0.45
isOneColumnMethod · 0.45
showBackFromStackMethod · 0.45

Tested by

no test coverage detected