From 5a62232415bc3776989474faa6f4efb2e0c05d1a Mon Sep 17 00:00:00 2001 From: David Redondo Date: Fri, 17 Apr 2020 11:30:25 +0200 Subject: [PATCH] Use the same icon mode calculation for comboboxes as for buttons Summary: When hovering a focused combobox the icon was in Selected state resulting in a wrong color. Test Plan: Hover over a focused combobox that has an icon Reviewers: broulik, #breeze, ndavis Reviewed By: #breeze, ndavis Subscribers: ndavis, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D28908 --- kstyle/breezestyle.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp index 875ed8e2..8e874dd6 100644 --- a/kstyle/breezestyle.cpp +++ b/kstyle/breezestyle.cpp @@ -4455,13 +4455,10 @@ namespace Breeze if (!cb->currentIcon.isNull()) { QIcon::Mode mode; - if ((cb->state & QStyle::State_Selected) && (cb->state & QStyle::State_Active)) { - mode = QIcon::Selected; - } else if (cb->state & QStyle::State_Enabled) { - mode = QIcon::Normal; - } else { - mode = QIcon::Disabled; - } + if( !enabled ) mode = QIcon::Disabled; + else if( !flat && hasFocus ) mode = QIcon::Selected; + else if( mouseOver && flat ) mode = QIcon::Active; + else mode = QIcon::Normal; const QPixmap pixmap = _helper->coloredIcon(cb->currentIcon,cb->palette, cb->iconSize, mode); auto iconRect(editRect);