From fcc2e5dbafd402153bf287148eb22ac457247910 Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Wed, 28 Jan 2015 15:35:42 +0100 Subject: [PATCH] properly adjust menu icon size and positioning, to deal with button's offset in maximized mode. BUG: 343441 --- kdecoration/breezebutton.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kdecoration/breezebutton.cpp b/kdecoration/breezebutton.cpp index 25aa2737..5ac0cfe4 100644 --- a/kdecoration/breezebutton.cpp +++ b/kdecoration/breezebutton.cpp @@ -90,8 +90,11 @@ namespace Breeze if (type() == KDecoration2::DecorationButtonType::Menu) { - const QPixmap pixmap = decoration()->client().data()->icon().pixmap(size().toSize()); - painter->drawPixmap(geometry().center() - QPoint(pixmap.width()/2, pixmap.height()/2), pixmap); + + const QSizeF iconSize( size().width()-m_offset.x(), size().height()-m_offset.y() ); + const QRectF iconRect( geometry().topLeft(), iconSize ); + const QPixmap pixmap = decoration()->client().data()->icon().pixmap( iconSize.toSize()); + painter->drawPixmap(iconRect.center() - QPoint(pixmap.width()/2, pixmap.height()/2), pixmap); } else {