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
wilder-5.19
David Redondo 6 years ago
parent 49cff21273
commit 5a62232415
  1. 11
      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);

Loading…
Cancel
Save