Revert "MenuItem: Don't stretch icons, instead scale them down to fit rect"

This reverts commit c320472b60a04dce8fa347c49095fc0dab1fbfbf.

It was an older version of the patch, accidentally committed from the
wrong (KF6) copy of breeze repo. Oops!

(cherry picked from commit 7ddbd935c7a24688a242fda9f89eb91fbb5d0138)
wilder-reb-27
ivan tkachenko 3 years ago
parent 1413d99ea6
commit 3040e8d6f6
No known key found for this signature in database
GPG Key ID: AF72731B7C654CB3
  1. 3
      kstyle/breezehelper.cpp
  2. 1
      kstyle/breezestyle.cpp

@ -1617,8 +1617,7 @@ QPixmap Helper::coloredIcon(const QIcon &icon, const QPalette &palette, const QS
if (changePalette) {
KIconLoader::global()->setCustomPalette(palette);
}
const QSize actualSize = icon.actualSize(size, mode, state);
const QPixmap pixmap = icon.pixmap(actualSize, mode, state);
const QPixmap pixmap = icon.pixmap(size, mode, state);
if (changePalette) {
if (activePalette == QPalette()) {
KIconLoader::global()->resetPalette();

@ -5335,7 +5335,6 @@ bool Style::drawMenuItemControl(const QStyleOption *option, QPainter *painter, c
// icon state
const QIcon::State iconState(sunken ? QIcon::On : QIcon::Off);
const QPixmap icon = _helper->coloredIcon(menuItemOption->icon, menuItemOption->palette, iconRect.size(), mode, iconState);
iconRect = centerRect(iconRect, icon.size());
painter->drawPixmap(iconRect, icon);
}

Loading…
Cancel
Save