Apply editor settings when handling key presses

This commit is contained in:
Gres 2020-05-04 21:22:11 +03:00
parent 283624a564
commit 1d185c9402

View File

@ -236,11 +236,16 @@ void CaptureAreaSelector::hideEvent(QHideEvent * /*event*/)
void CaptureAreaSelector::keyPressEvent(QKeyEvent *event) void CaptureAreaSelector::keyPressEvent(QKeyEvent *event)
{ {
if (event->key() == Qt::Key_Escape) { if (event->key() == Qt::Key_Escape) {
if (editor_ && editor_->isVisible())
applyEditor();
cancel(); cancel();
return; return;
} }
if (event->key() == Qt::Key_Return) { if (event->key() == Qt::Key_Return) {
if (editor_ && editor_->isVisible())
applyEditor();
if (!areas_.empty()) { if (!areas_.empty()) {
captureAll(); captureAll();
} else { } else {