mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Desktop: on ESC, remove focus when editing dive fields
Give the user a way to accept the changes made to a dive-field by pressing ESC. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
8a33022f39
commit
1c854d580a
1 changed files with 6 additions and 3 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Reference in a new issue