QComboBox/WindowVistaStyle: restore focus rect

The focus rect for the QComboBox was removed during the refactoring done
in 5c60e4b8f9cc88e48f5e7652eefe90e1366ae23d.
Readd the functionality in a similar to
QWindowsStyle::drawComplexControl().

Fixes: QTBUG-69239
Change-Id: I74e4060fbe52432318e3c986fc838cf353d99843
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Christian Ehrlicher 2018-12-31 16:20:48 +01:00
parent 9636a43abc
commit 7ba16f4c1e

View File

@ -1664,9 +1664,15 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle
theme.stateId = CBXS_NORMAL; theme.stateId = CBXS_NORMAL;
d->drawBackground(theme); d->drawBackground(theme);
} }
if ((sub & SC_ComboBoxEditField) && (flags & State_HasFocus)) {
QStyleOptionFocusRect fropt;
fropt.QStyleOption::operator=(*cmb);
fropt.rect = proxy()->subControlRect(CC_ComboBox, option, SC_ComboBoxEditField, widget);
proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget);
}
} }
} }
break; break;
case CC_ScrollBar: case CC_ScrollBar:
if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(option)) if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(option))
{ {