Переглянути джерело

fix auto focus on Product field to work when clearing and saving in all code paths

Daniel Sheffield 3 роки тому
батько
коміт
bdaa2c32fd
2 змінених файлів з 2 додано та 1 видалено
  1. 1 1
      app/activities/TransactionEditor.py
  2. 1 0
      grocery_transactions.py

+ 1 - 1
app/activities/TransactionEditor.py

@@ -30,10 +30,10 @@ class TransactionEditor(FocusWidget):
             self.advance_focus(reverse=True)
         elif key == 'ctrl delete':
             self.clear()
+            self.focus_on_product()
             self.update()
         elif key == 'insert':
             self.save_and_clear_cb()
-            self.focus_on_product()
         elif key == 'ctrl p':
             self.focus_on_product()
         else:

+ 1 - 0
grocery_transactions.py

@@ -140,6 +140,7 @@ def _save_and_clear_callback(activity_manager):
     txn = activity_manager.get('transaction')
     activity_manager.app.save(txn.data)
     txn.clear()
+    txn.focus_on_product()
     activity_manager.show(txn.update())
 
 args = sys.argv