Back mouse button and key return you in stack.

Now you can use mouse Back button and Back keyboard button
to return from media overview through profile to the chat view.
This commit is contained in:
John Preston 2017-02-09 16:49:43 +03:00
parent 0518a456f8
commit bb7730eee1
2 changed files with 6 additions and 1 deletions

View File

@ -3067,6 +3067,11 @@ bool MainWidget::eventFilter(QObject *o, QEvent *e) {
Global::RefDialogsListFocused().set(true, false);
}
}
} else if (e->type() == QEvent::MouseButtonPress) {
if (static_cast<QMouseEvent*>(e)->button() == Qt::BackButton) {
showBackFromStack();
return true;
}
}
return TWidget::eventFilter(o, e);
}

View File

@ -130,7 +130,7 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
}
void InnerWidget::keyPressEvent(QKeyEvent *e) {
if (e->key() == Qt::Key_Escape) {
if (e->key() == Qt::Key_Escape || e->key() == Qt::Key_Back) {
emit cancelled();
}
}