1
0

Once a user inputs a fee, retain it.

It has long been a minor annoyance that this isn't the
default behaviour.  Semantics are as follows:

- Fees are calculated automatically, as usual, and shown
  in black
- If the user inputs a fee, it is retained, and shown in
  blue to indicate it is user-overridden
- The user can switch back to automatic fee calculation mode
  in two ways: press Clear, or blank out the fee field
- User fees are also cleared by do_clear(), for instance when
  the payment is sent

I have checked all usage combinations I could think of, including
the ! case, and all work in a sensible and natural fashion.

This also fixes issue #995.
This commit is contained in:
Neil Booth
2015-07-03 20:14:12 +09:00
parent 250bb03034
commit aa6de86c27
3 changed files with 37 additions and 22 deletions

View File

@@ -45,6 +45,9 @@ class AmountEdit(MyLineEdit):
s = s.replace('.','')
s = s[:p] + '.' + s[p:p+self.decimal_point()]
self.setText(s)
# setText sets Modified to False. Instead we want to remember
# if updates were because of user modification.
self.setModified(self.hasFocus())
self.setCursorPosition(pos)
def paintEvent(self, event):