aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--desktop-widgets/tab-widgets/maintab.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp
index 677b5adb2..11ec9690b 100644
--- a/desktop-widgets/tab-widgets/maintab.cpp
+++ b/desktop-widgets/tab-widgets/maintab.cpp
@@ -721,9 +721,8 @@ void MainTab::acceptChanges()
struct dive *d;
bool do_replot = false;
- if (ui.location->hasFocus()) {
- this->setFocus();
- }
+ if (ui.location->hasFocus())
+ setFocus();
acceptingEdit = true;
tabBar()->setTabIcon(0, QIcon()); // Notes
@@ -1337,8 +1336,12 @@ void MainTab::editWeightWidget(const QModelIndex &index)
void MainTab::escDetected()
{
+ // In edit mode, pressing escape cancels the current changes.
+ // In standard mode, remove focus of any active widget to
if (editMode != NONE)
rejectChanges();
+ else
+ setFocus();
}
void MainTab::clearTabs() {