From: vsr Date: Fri, 22 Jul 2011 11:36:41 +0000 (+0000) Subject: Issue 0021328: EDF 1920 PARAVIS: Missing drop down menu in the calculator X-Git-Tag: OpenCV_demo1~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9f9d6164cec2c6f7a10bb53b96523fe6f3d28e65;p=modules%2Fgui.git Issue 0021328: EDF 1920 PARAVIS: Missing drop down menu in the calculator --- diff --git a/src/Style/Style_Salome.cxx b/src/Style/Style_Salome.cxx index 5c248bab1..cf4d24942 100644 --- a/src/Style/Style_Salome.cxx +++ b/src/Style/Style_Salome.cxx @@ -796,7 +796,7 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, break; } case CE_PushButtonBevel: - if ( qstyleoption_cast(opt) ) { + if ( const QStyleOptionButton *btn = qstyleoption_cast(opt) ) { double aRad = model()->widgetRounding( Style_Model::ButtonRadius ); bool aStateOn = opt->state & ( State_Sunken | State_On ); bool isAutoRaising = model()->widgetEffect() == Style_Model::AutoRaiseEffect; @@ -819,6 +819,12 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, else Style_Tools::shadowRect( p, r, aRad, -1, SHADOW, Style_Tools::All, top, bottom, aBrdTopCol, aBrdBotCol, antialized, true, aStateOn ); + if (btn->features & QStyleOptionButton::HasMenu) { + int mbi = pixelMetric(PM_MenuButtonIndicator, btn, w); + QStyleOptionButton newBtn = *btn; + newBtn.rect = QRect(r.right() - mbi-2, r.height()/2 - mbi/2, mbi, mbi); + drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, w); + } break; } case CE_DockWidgetTitle: