Page MenuHomePhabricator

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

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

Details

Summary

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
unresponsive.
Example scenario:

  1. Check the "Connect through SOCKS5 proxy" checkbox
  2. Set the proxy IP to 127.0.0.1.42 (invalid) and click OK. The input fields is red'ed and a error tooltip displayed.
  3. Change the proxy IP to 127.0.0.1 (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

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable