This PR proposes a small change in QLineEdit when there is an error in the input.
master |
---|
PR |
---|
This also shows good results when combined with other open PRs.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
No conflicts as of last run.
IMO this improves text contrast.
However, other improvements could be made as well, some suggestions:
ACK fe7c81e34e2e16c4a5ec967645ebb49e161d3a25
I’m ACK on this change specifically, there could be an accessibility improvement to this change (ping @RandyMcMillan)
I disagree that, in the case of #537, this “shows good results when combined with other open PRs” :)
consistent error message near the invalid fields, for instance, the error message for invalid change address is displayed on the right while the upcoming bech32 error shows on the top @promag I addressed this suggestion in https://github.com/bitcoin-core/gui/pull/560
@jarolrod - thanks for pinging me on this - my apologizes for not seeing it sooner… @w0xlt,
Just to define the issue with more clarity,
We can see using this color contrast calculator that in the light theme (on Mac) that the black text on the rgb(255,128,128) is “ok” kinda… :)
But when we switch to the dark theme (on Mac) the contrast becomes unsatisfactory from a contrast perspective and is apparent just by looking at it.
When fe7c81e34e2e16c4a5ec967645ebb49e161d3a25 is tested against light/dark theme changes (on Mac) we get…
which doesn’t work because the text color is changed based on system theme…
Here are a couple patches to experiment with palleteRole in Qt: You will have to call the text field to update during the system theme change - other wise it will only update when it receives focus.
0diff --git a/src/qt/guiconstants.h b/src/qt/guiconstants.h
1index 60e8ee2420..8b37c5dfb4 100644
2--- a/src/qt/guiconstants.h
3+++ b/src/qt/guiconstants.h
4@@ -25,7 +25,7 @@ static const int STATUSBAR_ICONSIZE = 16;
5 static const bool DEFAULT_SPLASHSCREEN = true;
6
7 /* Invalid field background style */
8-#define STYLE_INVALID "border: 3px solid #FF8080"
9+#define STYLE_INVALID "color: palette(highlighted-text); background-color: pallet(shadow); border: 3px solid #FF8080"
10
11 /* Transaction list -- unconfirmed transaction */
12 #define COLOR_UNCONFIRMED QColor(128, 128, 128)
0diff --git a/src/qt/guiconstants.h b/src/qt/guiconstants.h
1index 60e8ee2420..dca896ca7e 100644
2--- a/src/qt/guiconstants.h
3+++ b/src/qt/guiconstants.h
4@@ -25,7 +25,7 @@ static const int STATUSBAR_ICONSIZE = 16;
5 static const bool DEFAULT_SPLASHSCREEN = true;
6
7 /* Invalid field background style */
8-#define STYLE_INVALID "border: 3px solid #FF8080"
9+#define STYLE_INVALID "color: palette(highlighted-text); background-color: pallet(window); border: 3px solid #FF8080"
10
11 /* Transaction list -- unconfirmed transaction */
12 #define COLOR_UNCONFIRMED QColor(128, 128, 128)
Revisited this, and it is in fact an improvement. Specifically, there’s is an improvement for text contrast when in dark mode. Additionally it makes the UI language around a sending error consistent.
improvement with text contrast in dark mode:
master | PR |
---|---|
ACK fe7c81e34e2e16c4a5ec967645ebb49e161d3a25
Screenshot:
Master | PR |
---|---|
palette(window)
, palette(shadow)
) and also palette(base)
, but none of them worked.
However I didn’t test on MacOS, I did it on Ubuntu by setting the theme using Qt5 Settings.
There hasn’t been much activity lately. What is the status here?
Finding reviewers may take time. However, if the patch is no longer relevant, please close this pull request. If the author lost interest or time to work on this, please close it and mark it ‘Up for grabs’ with the label, so that it can be picked up in the future.
🤔 There hasn’t been much activity lately and the CI seems to be failing.
If no one reviewed the current pull request by commit hash, a rebase can be considered. While the CI failure may be a false positive, the CI hasn’t been running for some time, so there may be a real issue hiding as well. A rebase triggers the latest CI and makes sure that no silent merge conflicts have snuck in.
ACK fe7c81e
Just got the DrahtBot notification and realized I was asked for my input. Sorry, for the delay on this. I agree with this change. The text remains more legible. Also visually less jarring with the outline.
If one wanted to keep a red background, it could also be a red with transparency (15-25% might be enough). That would avoid the thick border, still draw enough attention, and not impact contrast so much.