Skip to content
  • snooxx 💤's avatar
    KExtendableItemDelegate: Fix HiDPI positioning of indicator arrows · 1c155481
    snooxx 💤 authored
    After fixing pixelated indicator arrows in `KShortcutsEditorDelegate`
    (i.e. a subclass, see kxmlgui!104) used in the
    "Configure Keyboard Shortcuts" dialog, they were not drawn centered
    anymore, e.g. slightly moved upwards. The same problem can be observed
    in the download list of KGet.
    
    This is because the increased size of the pixmap is not accounted for.
    
    By transforming the pixmap size to device independent dimensions
    again, as used in the positioning calculations, the arrows will finally
    be shown correctly.
    
    Note that running `KItemViews` in conjunction with a version of
    `KXmlGUI` not including the fix will still work fine, since the
    `devicePixelRatio` will only ever be set to `1` in that case.
    
    CCBUG: 414904
    
    Test Plan:
      - Launch `QT_SCALE_FACTOR=1.7 ./bin/kxmlguiwindowtest`
        (from KXmlGui, including the fix mentioned above).
      - Open "Configure Keyboard Shortcuts" dialog.
      - Arrows in "Shortcut" column positioned correctly, for both their
        expanded and collapsed states.
      - Test with `-style Fusion` and other scaling factors, too.
      - `QT_SCALE_FACTOR=1.7 kget`, start download, observe indicator arrow
        in download list.
    1c155481