summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tab-widgets/maintab.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/tab-widgets/maintab.cpp')
-rw-r--r--desktop-widgets/tab-widgets/maintab.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp
index cc4f4faac..099487aea 100644
--- a/desktop-widgets/tab-widgets/maintab.cpp
+++ b/desktop-widgets/tab-widgets/maintab.cpp
@@ -727,7 +727,7 @@ void MainTab::acceptChanges()
bool do_replot = false;
if (ui.location->hasFocus())
- setFocus();
+ stealFocus();
EditMode lastMode = editMode;
editMode = IGNORE;
@@ -1077,6 +1077,13 @@ void MainTab::editWeightWidget(const QModelIndex &index)
ui.weights->edit(index);
}
+// Remove focus from any active field to update the corresponding value in the dive.
+// Do this by setting the focus to ourself
+void MainTab::stealFocus()
+{
+ setFocus();
+}
+
void MainTab::escDetected()
{
// In edit mode, pressing escape cancels the current changes.
@@ -1084,7 +1091,7 @@ void MainTab::escDetected()
if (editMode != NONE)
rejectChanges();
else
- setFocus();
+ stealFocus();
}
void MainTab::clearTabs()