Fix a bug in the calibre style that prevented popup arrow from showing on buttons that have a popup delay, such as the authors to author sort button in the edit metadata dialog

This commit is contained in:
Kovid Goyal 2014-08-16 21:03:57 +05:30
parent 4dbc1b5c43
commit 110dfad9d1

View File

@ -182,7 +182,7 @@ class CalibreStyle: public QProxyStyle {
case CC_ToolButton:
// We do not want an arrow if the toolbutton has an instant popup
toolbutton = qstyleoption_cast<const QStyleOptionToolButton *>(option);
if (toolbutton && toolbutton->features & QStyleOptionToolButton::HasMenu & ~QStyleOptionToolButton::PopupDelay) {
if (toolbutton && (toolbutton->features & QStyleOptionToolButton::HasMenu) && !(toolbutton->features & QStyleOptionToolButton::PopupDelay)) {
QStyleOptionToolButton opt = QStyleOptionToolButton(*toolbutton);
opt.features = toolbutton->features & ~QStyleOptionToolButton::HasMenu;
return QProxyStyle::drawComplexControl(control, &opt, painter, widget);