Ugly RPC Console Output on macOS #273

issue jarolrod openend this issue on April 6, 2021
  1. jarolrod commented at 11:21 pm on April 6, 2021: member

    Edit: This is a macOS specific issue. A monospace font is used on Linux and windows, but not on macOS. Add to the list of reasons to embed a regular monospace font.

    The help output for any RPC command is formatted differently in the macOS GUI console versus a Linux GUI console.

    With the Linux GUI console, the type/descriptions for an argument/result are shown at a uniform distance from the argument/result itself, thanks to the use of a monospace font.

    With the macOS GUI console, the type/descriptions do not line up because a monospace font is not used. This leads to ‘ugly’ output.

    Example: help setwalletflag

    macOS GUI RPC Console Screen Shot 2021-04-06 at 7 07 06 PM

    Linux GUI RPC Console Screen Shot 2021-04-08 at 11 49 15 AM

  2. jarolrod added the label Bug on Apr 6, 2021
  3. jarolrod renamed this:
    Ugly RPC Console Help Output
    Ugly RPC Console Output on macOS
    on Apr 8, 2021
  4. hebasto added the label Design on Apr 10, 2021
  5. hebasto added the label macOS on Apr 10, 2021
  6. hebasto commented at 6:35 am on April 10, 2021: member

    A monospace font is used on Linux and windows, but not on macOS.

    Actually, the font family in the default stylesheet https://github.com/bitcoin-core/gui/blob/f0fa32450ec35056b3e1025262aeaef4a24c35ee/src/qt/rpcconsole.cpp#L805-L817 is set correctly to .AppleSystemUIFontMonospaced.

    But this approach (using styleesheets) does not work on macOS. Probably, the reason of such behavior is the fact that .AppleSystemUIFontMonospaced is a private font family.

    UPDATE. From Qt Style Sheets docs:

    However, this wasn’t guaranteed to work for all styles, because style authors are restricted by the different platforms’ guidelines and (on Windows and macOS) by the native theme engine.

  7. hebasto commented at 7:37 am on April 10, 2021: member

    Maybe, the following patch

     0diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
     1index 34d055e5a..1acfaa3b2 100644
     2--- a/src/qt/rpcconsole.cpp
     3+++ b/src/qt/rpcconsole.cpp
     4@@ -803,7 +803,7 @@ void RPCConsole::clear(bool clearHistory)
     5     }
     6 
     7     // Set default style sheet
     8-    QFontInfo fixedFontInfo(GUIUtil::fixedPitchFont());
     9+    QFontInfo fixedFontInfo(GUIUtil::fixedPitchFont(true));
    10     ui->messagesWidget->document()->setDefaultStyleSheet(
    11         QString(
    12                 "table { }"
    

    is a step to fix this issue?

  8. hebasto removed the label Bug on May 8, 2021
  9. hebasto removed the label Design on May 8, 2021
  10. hebasto added the label UI on May 8, 2021
  11. hebasto referenced this in commit 9facad0da6 on Nov 25, 2021
  12. hebasto commented at 8:01 am on November 25, 2021: member
    Closing via #477.
  13. hebasto closed this on Nov 25, 2021

  14. sidhujag referenced this in commit 93b38bbffa on Nov 25, 2021
  15. bitcoin-core locked this on Nov 25, 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-11-21 12:20 UTC

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