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

SystemPalette should expose Link and LinkVisited colors

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Reported
    • Priority: Not Evaluated
    • Resolution: Unresolved
    • Affects Version/s: 5.6.0
    • Fix Version/s: None
    • Labels:
      None

      Description

      The SystemPallete QML element exposes most QPalette colors but not Link or LinkVisited, which makes it cumbersome to access those colors inside QML, and impossible from a purely QML based application. Most other colors are unnecessary in a QML program, but you often put links in text elements, and not being able to style them against the system theme makes them jarring.

      Adding these two to SystemPalette lets you set them on Text through inline CSS on Styled or Rich text, or even the linkColor property.

      In documentation, these colors are mentioned not to be used by Qt itself - which is proper, in that users will use the system palette to style elements appropriately. But not exposing them at all is just a headache to deal with, especially when trying to avoid compiled code for, say, a plasmoid. It is the distinction between Label's link color defaulting to the system palette one versus developers just not being able to access that color at all to set it themselves.

      Attached is the patch to just add these two to declarative so they show up in the SystemPalette element. From there, one can just set per-text element styling on every text field that uses links in a reusable manner, without infringing on the intent of the original QPalette::Link / Visited behavior.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              qt.team.quick.subscriptions Qt Quick and Widgets Team
              Reporter:
              zanny Matthew
              Votes:
              6 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes