Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-70652

Fusion palette regression in 5.12 (macOS)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.12
    • 5.12.0 Alpha, 5.12.0 Beta 4
    • None
    • macOS 10.13.6
    • macOS
    • e25970ffff3db1d0b2de17510514b5f92c5ba3e

    Description

      In 5.12 QuickControls2 palette handling seems to have changed. Please see the screenshots for the differences between 5.11 and 5.12. macOS is configured to use an orange selection color.

      General Issues (neither 5.11 nor 5.12 specific):

      On macOS the selection color is used for two things: text selection (a lighter variant) and item selection (a darker variant). For text selection "palette.highlightedText" should be #000000, for item selection "palette.highlightText" should be #ffffff. It seems that the Fusion ItemDelegate implementation and the Mac widget theme somehow heuristically select #ffffff - I think there is a mismatch between Qt's and macOS' view of a palette that cannot easily be fixed so we probably have to live with that.

      But now for the actual problem: When implementing a custom ItemDelegate's contentItem it's usually necessary to set a Text element's color to either "control.palette.text" or "control.palette.highlightedText" depending on the delegates "highlighted" property. A customized background can also access "control.palette.highlight" to get the correct (darker, see "actual bgc" output) selection color. So this works reasonably well with 5.11.

      Here comes 5.12:

      Even without any customization ListView + ItemDelegate no longer respect the user's color settings. The unselected background color is now grayish (#ececec) when it was white in 5.11. Regardless of the user's settings the selected background color is now some kind of blue. I've found the value "#3c8ce6" hardcoded in QQuickFusionStyle::highlight where some heuristic detects "isMacSystemPalette". Why that heuristic does not spoil the party in 5.11 I don't know, the code seems to be untouched since its introduction

      When customizing ItemDelegate it is no longer possible to query the correct colors. "control.palette.highlightedText" is now black instead of white and "control.palette.highlight" is the wrong lighter text selection color (same as in SystemPalette).

      This is a regression for desktop targeting QtQuick based applications.

      Haven't tried Windows yet so maybe this is a macOS only problem.

      A sample project (used for the screenshots) is attached.

      Attachments

        1. fusion_5_11.png
          fusion_5_11.png
          112 kB
        2. fusion_5_12.png
          fusion_5_12.png
          110 kB
        3. fusionpalette.tgz
          2 kB
        4. qtbug70652.zip
          4 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tpochep Timur Pocheptsov
            njeisecke Nils Jeisecke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes