Skip to content
  • David Edmundson's avatar
    Fix app icon button in window decos with high DPI in previews. · e827fa08
    David Edmundson authored
    Summary:
    With both Qt devicePixelRatio > 1 and Qt::AA_UseHighDpiPixmaps set
    QIcon.pixmap() will return a bigger image than the size requested, with
    the relevant devicePixelRatio set.
    
    This code is trying to center an icon within a bounding rect, (like
    QStyle::drawItemPixmap) and so positioning should use normalised pixels,
    not actual pixmap pixels.
    
    This affected Systemsettings previews but not kwin.
    
    Reviewers: #plasma, mart
    
    Reviewed By: #plasma, mart
    
    Subscribers: mart, plasma-devel
    
    Tags: #plasma
    
    Differential Revision: https://phabricator.kde.org/D6763
    e827fa08