Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix text color in amount edit widget for dark style #210

Merged
merged 1 commit into from
May 27, 2022

Conversation

PiRK
Copy link
Collaborator

@PiRK PiRK commented May 27, 2022

The second call to ColorScheme.update_from_widget did not take the user setting (force_dark) into consideration, and was not able to detect that the first call set the dark theme, so it overwrote the ColorScheme setting used by the amount edit widget to determine the text color.

This is strange because I would expect the first call to change the stylesheet, and so make the second call autodetect that the dark theme is in use via ColorScheme.has_dark_background, but it somehow does not work. Maybe Qt does not apply the stylesheet before reaching the event loop, so the autodetection of the theme base on the QWidget background color does not work at this point in the initialization of the application.

Before:

Screenshot from 2022-05-27 09-54-17
Screenshot from 2022-05-27 09-54-23
Screenshot from 2022-05-27 09-54-32

After:

Screenshot from 2022-05-27 09-53-17
Screenshot from 2022-05-27 09-53-43
Screenshot from 2022-05-27 09-53-52

The second call to `ColorScheme.update_from_widget` did not take the user setting  (`force_dark`) into consideration, so it overwrote the ColorScheme setting. This is strange because I would expect the first call to change the stylesheet, and so make the second call autodetect that the dark theme is in use via `ColorScheme.has_dark_background`, but it somehow does not work. Maybe Qt change something in the way the stylesheet is applied, and it is not taken into account by the time the second call occurs.

This changes the behavior to the one used by electrum. Hopefully there aren't too many Electrum ABC plugins messing with the color theme.
@PiRK PiRK merged commit 0eb157e into Bitcoin-ABC:master May 27, 2022
cculianu pushed a commit to cculianu/Electron-Cash that referenced this pull request May 27, 2022
It turns out it was broken all this time.  This is a partial backport
of: Bitcoin-ABC#210
@PiRK PiRK changed the title fix ColorScheme for dark style fix text color in amount edit widget for dark style May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant