Support runtime appearance adjustment on macOS #275

pull hebasto wants to merge 12 commits into bitcoin-core:master from hebasto:210409-dark changing 18 files +228 −41
  1. hebasto commented at 6:35 am on April 9, 2021: member

    On macOS switching appearance (Light -> Dark or Dark -> Light) when Bitcoin Core is running makes the GUI pretty unusable. This bug is especially important when a user chose the “Auto” mode to adjust appearance automatically.

    This PR fixes Bitcoin Core behavior.

    This is an alternative to #268.

  2. hebasto added the label macOS on Apr 9, 2021
  3. hebasto commented at 6:44 am on April 9, 2021: member

    @goums @jarolrod

    Do you mind testing this PR?

  4. RandyMcMillan commented at 8:53 pm on April 19, 2021: contributor

    Concept ACK 3696ebc873bd71e1a7036200d8f1cf96d262fb9f

    Wow! Looks great!

    MacOS 10.14.6 (18G8022) Light Theme

    Screen Shot 2021-04-19 at 4 42 44 PM

    MacOS 10.14.6 (18G8022) Dark Theme

    Screen Shot 2021-04-19 at 4 42 56 PM

  5. RandyMcMillan commented at 9:06 pm on April 19, 2021: contributor

    This window should probably be aware of the color scheme as well…

    Screen Shot 2021-04-19 at 5 05 04 PM

  6. hebasto commented at 9:25 pm on April 19, 2021: member

    This window should probably be aware of the color scheme as well…

    Leaving it as is because have no nice design solution for now.

  7. RandyMcMillan commented at 9:33 pm on April 19, 2021: contributor

    Concerning Accessibility: Using Accessibility Inspector on MacOS…

    Screen Shot 2021-04-19 at 5 29 30 PM

    When inverting colors - the warning doesn’t have enough contrast. Maybe in a follow up this can be addressed.

    Access1

    Access2

  8. jarolrod commented at 2:59 am on April 20, 2021: member

    Concept ACK

    Spent all day playing around with this and have some findings. These are the main points summarized:

    The State of macOS Dark Mode Support:

    • This PR does allow for runtime appearance adjustment
    • Dark mode does not work when compiled through depends natively on macOS 11 and 10.15. It does work on macOS 10.14 (out of scope of this PR)
    • The Linux cross-compiles work, this is important as the release binaries are cross-compiled from linux
      • There is a weird bug with rows in a table, they have their borders colored in white when in dark mode.
    • The macOS tool bump would break dark mode again (out of scope of this PR)

    What this PR should fix:

    • Should fix the bug with tables when cross-compiled from linux

    Below are pictures of this PR [natively compiled, native depends, cross-compile, cross-compile with macOS toolchain bump (19817)] on macOS [10.14, 10.15, 11]

    macOS 10.14 Mojave

    Native Compile

    Start: Dark Mode Switch: Light Mode
    Screen Shot 2021-04-19 at 7 25 24 PM Screen Shot 2021-04-19 at 7 25 48 PM

    Native Depends Build

    Start: Dark Mode Switch: Light Mode
    Screen Shot 2021-04-19 at 7 28 38 PM Screen Shot 2021-04-19 at 7 27 59 PM

    Linux Cross-Compile for macOS

    Start: Dark Mode Switch: Light Mode
    Screen Shot 2021-04-19 at 9 41 15 PM Screen Shot 2021-04-19 at 9 41 34 PM

    This PR + macOS Toolchain Bump

    Start: Dark Mode Switch: Light Mode
    Screen Shot 2021-04-19 at 8 54 03 PM Screen Shot 2021-04-19 at 8 54 15 PM

    macOS 10.15 Catalina

    Native Compile

    Start: Dark Mode Switch: Light Mode
    Screen Shot 2021-04-11 at 11 11 23 PM Screen Shot 2021-04-11 at 11 12 04 PM

    Native Depends Build

    Start: Dark Mode Switch: Light Mode
    Screen Shot 2021-04-19 at 8 31 07 PM Screen Shot 2021-04-19 at 8 31 19 PM

    Linux Cross-Compile for macOS

    Start: Dark Mode Switch: Light Mode
    Screen Shot 2021-04-19 at 9 58 48 PM Screen Shot 2021-04-19 at 9 59 12 PM

    This PR + macOS Toolchain Bump

    Start: Dark Mode Switch: Light Mode
    Screen Shot 2021-04-19 at 8 42 49 PM Screen Shot 2021-04-19 at 8 43 00 PM

    macOS 11 Big Sur

    Native Compile

    Start: Dark Mode Switch: Light Mode
    Screen Shot 2021-04-12 at 1 37 45 AM Screen Shot 2021-04-12 at 1 38 04 AM

    Native Depends Build

    Start: Dark Mode Switch: Light Mode
    Screen Shot 2021-04-19 at 10 51 53 PM Screen Shot 2021-04-19 at 10 52 11 PM

    Linux Cross-Compile for macOS

    Start: Dark Mode Switch: Light Mode
    Screen Shot 2021-04-19 at 9 27 40 PM Screen Shot 2021-04-19 at 9 28 12 PM

    This PR + macOS Toolchain Bump

    Start: Dark Mode Switch: Light Mode
    Screen Shot 2021-04-19 at 8 47 59 PM Screen Shot 2021-04-19 at 8 48 59 PM
  9. hebasto commented at 4:29 pm on April 20, 2021: member

    @RandyMcMillan

    Concerning Accessibility: Using Accessibility Inspector on MacOS…

    Accessibility is out of this PR scope, as its only goal is the smooth runtime switching between dark and light appearances (note that the dark appearance is supported since #154).

    I’ll be happy to review dedicated prs that improves accessibility. Probably, it’d be nice to start from some kind of a design guide.

  10. hebasto commented at 4:37 pm on April 20, 2021: member

    @jarolrod

    Spent all day playing around with this and have some findings.

    Many thanks for your extensive testing and reviewing!

    • Dark mode does not work when compiled through depends natively on macOS 11 and 10.15. It does work on macOS 10.14 (out of scope of this PR)

    Sorry, still investigating this weird issue.

    • There is a weird bug with rows in a table, they have their borders colored in white when in dark mode.

    Is this our bug or Qt’s one (upstream)? Is this bug of the switching between modes? Or it was present in #154?

  11. promag commented at 10:07 am on April 28, 2021: contributor
    Quickly tested ACK 57373016e6d581e2a0d32b0cfaf8c63d28a9c20b. I’ve tested this rebased with https://github.com/bitcoin/bitcoin/pull/21793.
  12. qt: Make PlatformStyle aware of runtime palette change
    This change is a prerequisite to support changeable appearance on macOS.
    ce17861dc4
  13. qt: Make BitcoinGUI aware of runtime palette change
    This change fixes the GUI when changing appearance on macOS.
    f1083826e3
  14. qt: Make RPCConsole aware of runtime palette change
    This change fixes the GUI when changing appearance on macOS.
    fa18d28e12
  15. qt: Make SendCoinsEntry aware of runtime palette change
    This change fixes the GUI when changing appearance on macOS.
    0dcc3fac43
  16. qt: Make SignVerifyMessageDialog aware of runtime palette change
    This change fixes the GUI when changing appearance on macOS.
    c054720e08
  17. qt: Add GUIUtil::ThemedLabel class
    The ThemedLabel class correctly handles appearance changes on macOS.
    d99ef327a8
  18. qt: Use GUIUtil::ThemedLabel class
    This change fixes the GUI when changing appearance on macOS.
    ff530a2093
  19. qt: Replace base class of ClickableLabel with ThemedLabel
    This change fixes the GUI when changing appearance on macOS.
    6b2ce65392
  20. qt: Make UnitDisplayStatusBarControl aware of runtime palette change
    This change fixes the GUI when changing appearance on macOS.
    d05f1b278d
  21. qt: Make OverviewPage aware of runtime palette change
    This change fixes the GUI when changing appearance on macOS.
    97a6b5e06a
  22. qt: Make CoinControlDialog aware of runtime palette change
    This change fixes the GUI when changing appearance on macOS.
    2b622d4ace
  23. qt: Make TransactionView aware of runtime palette change
    This change fixes the GUI when changing appearance on macOS.
    c231254a65
  24. hebasto force-pushed on May 1, 2021
  25. hebasto commented at 12:23 pm on May 1, 2021: member
    Rebased 57373016e6d581e2a0d32b0cfaf8c63d28a9c20b -> c231254a65d390a3350fcef456d57e4a6eca0506 (pr275.01 -> pr275.02) on top of the merged https://github.com/bitcoin/bitcoin/pull/21793 – the dark mode works for every build :)
  26. hebasto added this to the milestone 22.0 on May 8, 2021
  27. hebasto commented at 11:26 am on May 27, 2021: member

    @promag @jarolrod @Sjors

    Do you mind having a (final) look at this PR after the recent rebasing?

  28. Sjors commented at 12:07 pm on May 27, 2021: member

    This PR does not enable the dark mode for builds that have this feature unavailable now, i.e., native builds with depends.

    Is this still true after the latest dependency bumps?

  29. hebasto commented at 12:09 pm on May 27, 2021: member

    @Sjors

    This PR does not enable the dark mode for builds that have this feature unavailable now, i.e., native builds with depends.

    Is this still true after the latest dependency bumps?

    Good catch! Removed.

  30. Sjors commented at 4:52 pm on May 27, 2021: member

    tACK c231254a65d390a3350fcef456d57e4a6eca0506 on macOS 11.4

    The code changes look sane, but I didn’t study them in detail.

    This should also be tested on Linux and Windows, since not everything is wrapped in #ifdef Q_OS_MACOS.

    I tested with and without depends. I’m able to toggle between dark and light mode in various screens and it looks healthy.

  31. goums commented at 9:10 pm on May 27, 2021: none

    ACK c231254a65d390a3350fcef456d57e4a6eca0506

    Tested on mac OS Big Sur (11.2.3) Light/dark mode switching works very smoothly on every windows 👍 Compare to previous version, all icons and labels are re-colorized accordingly to the theme change

    Screen capture for those who are not testing on macOS:

    https://user-images.githubusercontent.com/5577626/119896943-0a817300-bf40-11eb-8464-a8f11c1e1270.mov

  32. goums approved
  33. jarolrod commented at 10:52 pm on May 27, 2021: member

    tACK c231254a65d390a3350fcef456d57e4a6eca0506

    Tested over all possible configurations (as i did here: #275#pullrequestreview-639461197). Also tested on Linux and Windows to ensure there are no introduced visual glitches. This looks good to merge.

  34. hebasto commented at 1:10 pm on May 28, 2021: member

    This should also be tested on Linux and Windows, since not everything is wrapped in #ifdef Q_OS_MACOS.

    On Linux Mint 20.1 (Qt 5.12.8) with installed qt5ct package I’m able to switch themes for Qt apps during their runtime. This PR does not add support for such theme switching on Linux though. It ls left for follow ups.

  35. promag commented at 2:20 pm on May 28, 2021: contributor
    Tested ACK c231254a65d390a3350fcef456d57e4a6eca0506 on macOS Big Sur arm64.
  36. hebasto merged this on May 28, 2021
  37. hebasto closed this on May 28, 2021

  38. hebasto deleted the branch on May 28, 2021
  39. sidhujag referenced this in commit 69d49c82b1 on May 29, 2021
  40. gwillen referenced this in commit 2645f8139a on Jun 1, 2022
  41. bitcoin-core locked this on Aug 16, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-10-23 00:20 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me