Move back by Back key in Intro / Info / Settings.

This commit is contained in:
John Preston 2018-09-27 17:28:57 +03:00
parent fdfc767930
commit 352fc55234
2 changed files with 5 additions and 3 deletions

View File

@ -971,7 +971,7 @@ void WrapWidget::resizeEvent(QResizeEvent *e) {
}
void WrapWidget::keyPressEvent(QKeyEvent *e) {
if (e->key() == Qt::Key_Escape) {
if (e->key() == Qt::Key_Escape || e->key() == Qt::Key_Back) {
if (hasStackHistory() || wrap() != Wrap::Layer) {
checkBeforeClose([=] { _controller->showBackFromStack(); });
return;

View File

@ -573,11 +573,13 @@ void Widget::updateControlsGeometry() {
void Widget::keyPressEvent(QKeyEvent *e) {
if (_a_show.animating() || getStep()->animating()) return;
if (e->key() == Qt::Key_Escape) {
if (e->key() == Qt::Key_Escape || e->key() == Qt::Key_Back) {
if (getStep()->hasBack()) {
historyMove(Direction::Back);
}
} else if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return || e->key() == Qt::Key_Space) {
} else if (e->key() == Qt::Key_Enter
|| e->key() == Qt::Key_Return
|| e->key() == Qt::Key_Space) {
getStep()->submit();
}
}