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

Mac QSystemTrayIcon scaling not retina-aware (and also wrong)

    XMLWordPrintable

    Details

    • Platform/s:
      macOS
    • Commits:
      f3699510d42e5ee910521c0463d9710f77ad4ff1

      Description

      Search for "qt_mac_create_nsimage" in "qsystemtrayicon_mac.cpp" and you will find multiple locations where it scales the icon to "scale x scale" where "scale" is "[[[NSApplication sharedApplication] mainMenu] menuBarHeight] - 4".

      This value does not depend on the pixel scale factor, so we get low-res icons on retina capable systems, even though we supply high resolution icons.

      Also it is less than ideal to scale it to a square with sides equal to the menu bar height (minus 4), since icons on mac can typically be rectangular. In particular, I have pixel perfect icons designed for mac, and would like them to be used 1:1.

      I wish there was a virtual method or something I could override in QSystemTrayIcon to get get my wanted (correct) behavior, while the default could implement the backward compatible behavior.

      By the way, I can not find "qsystemtrayicon_mac.cpp" in the Qt 5.1.1 sources (qt-everywhere-opensource-src-5.1.1), so I don't know whether it's affected.

        Attachments

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

          Activity

            People

            Assignee:
            sorvig Morten Sørvig
            Reporter:
            robinei Robin Eidissen
            Votes:
            7 Vote for this issue
            Watchers:
            16 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes