Page MenuHomePhabricator

[QT] Undim the validation button as the user updates the validated field

Authored by Fabien on Mar 3 2021, 15:35.



The validated inputs (e.g. the proxy IP in Settings=>Options=>Network)
will change their appearance and display a message when the content is
invalid. The current behavior is to update this status when the widget
gains or loses the focus; however the focus out event is not triggered
when the user clicks the form container, making the UI feel
Example scenario:

  1. Check the "Connect through SOCKS5 proxy" checkbox
  2. Set the proxy IP to (invalid) and click OK. The input fields is red'ed and a error tooltip displayed.
  3. Change the proxy IP to (now valid). The OK button remains greyed and the input field red'ed despite valid. You need to click another button or field (such as the port field) to undim the OK button.

This diff emits a validationDidChange signal every time the validity
is changed. Since it is updated to valid on each input change, this
makes it possible to undim the OK button.
This is an alternative to D9294 which does not set a red background and
error message as you type, so is less "agressive" on the user.

Test Plan
Follow the steps above and check the OK button is now dimmed/undimmed

as soon as the content gets the focus.

Diff Detail

rABC Bitcoin ABC
Lint Not Applicable
Tests Not Applicable