Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-9025

Background color for mismatched parentheses is hardcoded to magenta, even in dark schemes.

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • Qt Creator 2.8.0-rc
    • None
    • Editors
    • None
    • 84e6ab02ed2d7e28af5f80468ca20b714053ccb4

      The background color for mismatched parentheses is not configurable. That's probably not a huge deal, but the color is wicked bright magenta. When using a dark theme, it burns out your eyeballs and you can't read the highlighted text.

      The color is set on line 273 in basetexteditor.cpp:

       
      d->m_mismatchFormat.setBackground(Qt::magenta);
      

      I'm not sure how much work it is to make this configurable. I'm not sure it's worth being configurable. Would it be quick and reasonable to check whether a dark or light scheme is being used, and if it's dark, use Qt::darkMagenta?

      There is a check for this in the method for printing:

      bool backgroundIsDark = background.value() < 128;
      

      Maybe we could change line 273 to:

      d->m_mismatchFormat.setBackground(background.value() < 128 ? Qt::darkMagenta : Qt::magenta);
      

      I'm not well-integrated enough to actually build, test, then submit a patch, but this looks like it should work.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            davschul David Schulz
            fsecilia Frank Secilia
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes