Changeset View
Changeset View
Standalone View
Standalone View
kstyle/breezestyle.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 4449 Lines • ▼ Show 20 Line(s) | 4421 | { | |||
---|---|---|---|---|---|
4450 | if (const auto cb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) | 4450 | if (const auto cb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) | ||
4451 | { | 4451 | { | ||
4452 | auto editRect = proxy()->subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, widget); | 4452 | auto editRect = proxy()->subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, widget); | ||
4453 | painter->save(); | 4453 | painter->save(); | ||
4454 | painter->setClipRect(editRect); | 4454 | painter->setClipRect(editRect); | ||
4455 | if (!cb->currentIcon.isNull()) { | 4455 | if (!cb->currentIcon.isNull()) { | ||
4456 | QIcon::Mode mode; | 4456 | QIcon::Mode mode; | ||
4457 | 4457 | | |||
4458 | if ((cb->state & QStyle::State_Selected) && (cb->state & QStyle::State_Active)) { | 4458 | if( !enabled ) mode = QIcon::Disabled; | ||
4459 | mode = QIcon::Selected; | 4459 | else if( !flat && hasFocus ) mode = QIcon::Selected; | ||
4460 | } else if (cb->state & QStyle::State_Enabled) { | 4460 | else if( mouseOver && flat ) mode = QIcon::Active; | ||
4461 | mode = QIcon::Normal; | 4461 | else mode = QIcon::Normal; | ||
4462 | } else { | | |||
4463 | mode = QIcon::Disabled; | | |||
4464 | } | | |||
4465 | 4462 | | |||
4466 | const QPixmap pixmap = _helper->coloredIcon(cb->currentIcon,cb->palette, cb->iconSize, mode); | 4463 | const QPixmap pixmap = _helper->coloredIcon(cb->currentIcon,cb->palette, cb->iconSize, mode); | ||
4467 | auto iconRect(editRect); | 4464 | auto iconRect(editRect); | ||
4468 | iconRect.setWidth(cb->iconSize.width() + 4); | 4465 | iconRect.setWidth(cb->iconSize.width() + 4); | ||
4469 | iconRect = alignedRect(cb->direction, | 4466 | iconRect = alignedRect(cb->direction, | ||
4470 | Qt::AlignLeft | Qt::AlignVCenter, | 4467 | Qt::AlignLeft | Qt::AlignVCenter, | ||
4471 | iconRect.size(), editRect); | 4468 | iconRect.size(), editRect); | ||
4472 | if (cb->editable) | 4469 | if (cb->editable) | ||
▲ Show 20 Lines • Show All 2660 Lines • Show Last 20 Lines |