HomePhabricator

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

Description

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

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.

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D9295

Details

Provenance
FabienAuthored on Mar 3 2021, 15:24
FabienPushed on Mar 3 2021, 19:31
Reviewer
Restricted Project
Differential Revision
D9295: [QT] Undim the validation button as the user updates the validated field
Parents
rABC49d776c2a3b2: [Cashtab] Migrate some css to styled components
Branches
Unknown
Tags
Unknown