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

Menubars font scaling doesn't match QT Scaling on Gnome desktop

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • Qt Creator 4.3.1
    • All Other Issues
    • Arch Linux 4.11.9-1-ARCH, Gnome Desktop Environment 3.24.2, Lenovo Yoga 910, res 3200 x 1800

    Description

      The following issue can be reproduced with a HiDPI resolution (In my case a resolution of 3200x1800 or 3840x2160) running Gnome 3.24.2.

      The scaling-factor is set to 2 by default, where the font scaling factor is set to 1. To ensure QT-Creator  remains visually pleasing and easily readable, I have set QT_SCALE_FACTOR=2.

       

      The issue persists in the menu bar font, which is based off gnome's font and interface scaling settings. As QT's and GTK's scaling system differs, the interface becomes very narrow and very unpleasant to use. See QT_BROKEN image below.

       

      To confirm that a conflict between the desktop environment and the QT framework is present, a small workaround has proven to fix the issue:

       

      If Gnome's font scaling has been decreased to say 0.5, and the application is started with the correct qt scale factor set, the size of the Menu bar appears to be acceptable in comparison to QT components. If the the font scale is reset back to one while qtcreator is still running, the menu bar remains unaffected by the change. See QT_FIXED image below.

       

       Trough this discovery I managed to write a workaround that would set the font scaling to 0.5 before the application is started, and reset it back to it's original value after the application has started :

       

      In .bashrc

       

      alias qtcreator="gsettings set org.gnome.desktop.interface text-scaling-factor 0.5; \
      (qtcreator &); \
      sleep 0.1; \
      gsettings reset org.gnome.desktop.interface text-scaling-factor "
      

       

      As you may have noticed by the screenshots, the menu bar is not the only component affected by this issue.

       

      While I have seen a fair amount of bug reports covering similar if not same issues, all of them have come to conclusions that were usually related to the GTK theme. In this case however, it clearly isn't. 

       

      Attachments

        1. QT_BROKEN.png
          QT_BROKEN.png
          166 kB
        2. QT_Fixed.png
          QT_Fixed.png
          157 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            portale Alessandro Portale
            ctxz Patrick Pedersen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes