Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/styles/qs60style.cpp

    r651 r769  
    5151#include "qdial.h"
    5252#include "qdialog.h"
     53#include "qmessagebox.h"
    5354#include "qgroupbox.h"
    5455#include "qheaderview.h"
     
    6263#include "qscrollbar.h"
    6364#include "qtabbar.h"
    64 #include "qtablewidget.h"
    6565#include "qtableview.h"
    6666#include "qtextedit.h"
     
    9393const layoutHeader QS60StylePrivate::m_layoutHeaders[] = {
    9494// *** generated layout data ***
    95 {240,320,1,15,"QVGA Landscape"},
    96 {320,240,1,15,"QVGA Portrait"},
    97 {360,640,1,15,"NHD Landscape"},
    98 {640,360,1,15,"NHD Portrait"},
     95{240,320,1,19,"QVGA Landscape"},
     96{320,240,1,19,"QVGA Portrait"},
     97{360,640,1,19,"NHD Landscape"},
     98{640,360,1,19,"NHD Portrait"},
    9999{352,800,1,12,"E90 Landscape"}
    100100// *** End of generated data ***
     
    105105const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = {
    106106// *** generated pixel metrics ***
    107 {5,0,-909,0,0,2,0,0,-1,7,12,19,13,13,6,200,-909,-909,-909,20,13,2,0,0,21,7,18,-909,3,3,1,-909,-909,0,1,0,0,12,20,15,15,18,18,1,115,18,0,-909,-909,-909,-909,0,0,16,2,-909,0,0,-909,16,-909,-909,-909,-909,32,18,55,24,55,3,3,4,9,13,-909,5,51,11,5,0,3,3,6,8,3,3,-909,2,-909,-909,-909,-909,5,5,3,1},
    108 {5,0,-909,0,0,1,0,0,-1,8,14,22,15,15,7,164,-909,-909,-909,19,15,2,0,0,21,8,27,-909,4,4,1,-909,-909,0,7,6,0,13,23,17,17,21,21,7,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,65,27,65,4,4,5,10,15,-909,5,58,13,5,0,4,4,7,9,4,4,-909,2,-909,-909,-909,-909,6,6,3,1},
    109 {7,0,-909,0,0,2,0,0,-1,25,69,28,19,19,9,258,-909,-909,-909,23,19,26,0,0,32,25,72,-909,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,5,5,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1},
    110 {7,0,-909,0,0,2,0,0,-1,25,68,28,19,19,9,258,-909,-909,-909,31,19,6,0,0,32,25,60,-909,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,5,5,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1},
    111 {7,0,-909,0,0,2,0,0,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,7,32,-909,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,6,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,5,6,8,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1}
     107{5,0,-909,0,0,2,0,0,-1,7,12,22,15,15,7,198,-909,-909,-909,20,13,2,0,0,21,7,18,30,3,3,1,-909,-909,0,1,0,0,12,20,15,15,18,18,1,115,18,0,-909,-909,-909,-909,0,0,16,2,-909,0,0,-909,16,-909,-909,-909,-909,32,18,55,24,55,4,4,4,9,13,-909,5,51,11,5,0,3,3,6,8,3,3,-909,2,-909,-909,-909,-909,5,5,3,1,106},
     108{5,0,-909,0,0,1,0,0,-1,8,14,22,15,15,7,164,-909,-909,-909,19,15,2,0,0,21,8,27,28,4,4,1,-909,-909,0,7,6,0,13,23,17,17,21,21,7,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,65,27,65,3,3,5,10,15,-909,5,58,13,5,0,4,4,7,9,4,4,-909,2,-909,-909,-909,-909,6,6,3,1,106},
     109{7,0,-909,0,0,2,0,0,-1,25,69,46,37,37,9,258,-909,-909,-909,23,19,26,0,0,32,25,72,44,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,13,13,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135},
     110{7,0,-909,0,0,2,0,0,-1,25,68,46,37,37,9,258,-909,-909,-909,31,19,6,0,0,32,25,60,52,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,12,12,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135},
     111{7,0,-909,0,0,2,0,0,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,7,32,30,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,6,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,5,6,8,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1,106}
    112112// *** End of generated data ***
    113113};
     
    120120// theme palette
    121121QPalette *QS60StylePrivate::m_themePalette = 0;
     122
     123qint64 QS60StylePrivate::m_webPaletteKey = 0;
     124
     125QPointer<QWidget> QS60StylePrivate::m_pressedWidget = 0;
    122126
    123127const struct QS60StylePrivate::frameElementCenter QS60StylePrivate::m_frameElementsData[] = {
     
    126130    {SE_FrameLineEdit,          QS60StyleEnums::SP_QsnFrInputCenter},
    127131    {SE_ListHighlight,          QS60StyleEnums::SP_QsnFrListCenter},
    128     {SE_OptionsMenu,            QS60StyleEnums::SP_QsnFrPopupCenter},
     132    {SE_PopupBackground,        QS60StyleEnums::SP_QsnFrPopupCenter},
    129133    {SE_SettingsList,           QS60StyleEnums::SP_QsnFrSetOptCenter},
    130134    {SE_TableItem,              QS60StyleEnums::SP_QsnFrCaleCenter},
     
    137141    {SE_ButtonInactive,         QS60StyleEnums::SP_QsnFrButtonCenterInactive},
    138142    {SE_Editor,                 QS60StyleEnums::SP_QsnFrInputCenter},
     143    {SE_TableItemPressed,       QS60StyleEnums::SP_QsnFrGridCenterPressed},
     144    {SE_ListItemPressed,        QS60StyleEnums::SP_QsnFrListPressed},
    139145};
    140146
     
    249255        drawFrame(SF_ListHighlight, painter, rect, flags | SF_PointNorth);
    250256        break;
    251     case SE_OptionsMenu:
    252         drawFrame(SF_OptionsMenu, painter, rect, flags | SF_PointNorth);
     257    case SE_PopupBackground:
     258        drawFrame(SF_PopupBackground, painter, rect, flags | SF_PointNorth);
    253259        break;
    254260    case SE_SettingsList:
     
    290296        drawFrame(SF_FrameLineEdit, painter, rect, flags | SF_PointNorth);
    291297        break;
     298    case SE_DropArea:
     299        drawPart(QS60StyleEnums::SP_QgnGrafOrgBgGrid, painter, rect, flags | SF_PointNorth);
     300        break;
     301    case SE_TableItemPressed:
     302        drawFrame(SF_TableItemPressed, painter, rect, flags | SF_PointNorth);
     303        break;
     304    case SE_ListItemPressed:
     305        drawFrame(SF_ListItemPressed, painter, rect, flags | SF_PointNorth);
     306        break;
    292307    default:
    293308        break;
     
    303318short QS60StylePrivate::pixelMetric(int metric)
    304319{
     320    //If it is a custom value, need to strip away the base to map to internal
     321    //pixel metric value table
     322    if (metric & QStyle::PM_CustomBase) {
     323        metric -= QStyle::PM_CustomBase;
     324        metric += MAX_NON_CUSTOM_PIXELMETRICS - 1;
     325    }
     326
    305327    Q_ASSERT(metric < MAX_PIXELMETRICS);
    306328    const short returnValue = m_pmPointer[metric];
     
    403425    const bool cachedColorExists = m_colorCache.contains(frame);
    404426    if (!cachedColorExists) {
    405         const int frameCornerWidth = pixelMetric(PM_Custom_FrameCornerWidth);
    406         const int frameCornerHeight = pixelMetric(PM_Custom_FrameCornerHeight);
     427        const int frameCornerWidth = pixelMetric(PM_FrameCornerWidth);
     428        const int frameCornerHeight = pixelMetric(PM_FrameCornerHeight);
    407429        Q_ASSERT(2 * frameCornerWidth < 32);
    408430        Q_ASSERT(2 * frameCornerHeight < 32);
     
    531553
    532554    if (orientation == Qt::Horizontal) {
     555        startRect.setHeight(rect.height());
    533556        startRect.setWidth(qMin((rect.width() >> 1) - 1, startRect.width()));
    534557        endRect = startRect.translated(rect.width() - startRect.width(), 0);
     
    540563        }
    541564    } else {
     565        startRect.setWidth(rect.width());
    542566        startRect.setHeight(qMin((rect.height() >> 1) - 1, startRect.height()));
    543567        endRect = startRect.translated(0, rect.height() - startRect.height());
     
    626650    } else if (qobject_cast<QGroupBox *>(widget)){
    627651        fontCategory = QS60StyleEnums::FC_Title;
     652    } else if (qobject_cast<QMessageBox *>(widget)){
     653        fontCategory = QS60StyleEnums::FC_Primary;
     654    } else if (qobject_cast<QMenu *>(widget)){
     655        fontCategory = QS60StyleEnums::FC_Primary;
     656    } else if (qobject_cast<QCalendarWidget *>(widget)){
     657        fontCategory = QS60StyleEnums::FC_Secondary;
    628658    }
    629659    if (fontCategory != QS60StyleEnums::FC_Undefined) {
     
    755785    widgetPalette = *palette;
    756786
     787    widgetPalette.setColor(QPalette::Text,
     788        s60Color(QS60StyleEnums::CL_QsnTextColors, 22, 0));
     789    widgetPalette.setColor(QPalette::HighlightedText,
     790        s60Color(QS60StyleEnums::CL_QsnTextColors, 11, 0));
     791    QApplication::setPalette(widgetPalette, "QMenu");
     792    widgetPalette = *palette;
     793
    757794    widgetPalette.setColor(QPalette::WindowText,
    758795        s60Color(QS60StyleEnums::CL_QsnTextColors, 4, 0));
     796    widgetPalette.setColor(QPalette::HighlightedText,
     797        s60Color(QS60StyleEnums::CL_QsnTextColors, 3, 0));
    759798    QApplication::setPalette(widgetPalette, "QTabBar");
    760799    widgetPalette = *palette;
    761800
     801    widgetPalette.setColor(QPalette::HighlightedText,
     802        s60Color(QS60StyleEnums::CL_QsnTextColors, 10, 0));
     803    QApplication::setPalette(widgetPalette, "QListView");
     804    widgetPalette = *palette;
     805
    762806    widgetPalette.setColor(QPalette::Text,
    763807        s60Color(QS60StyleEnums::CL_QsnTextColors, 22, 0));
     808    widgetPalette.setColor(QPalette::HighlightedText,
     809        s60Color(QS60StyleEnums::CL_QsnTextColors, 11, 0));
    764810    QApplication::setPalette(widgetPalette, "QTableView");
    765811    widgetPalette = *palette;
     
    770816        s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0));
    771817    QApplication::setPalette(widgetPalette, "QLineEdit");
    772     widgetPalette = *palette;
    773 
    774     widgetPalette.setColor(QPalette::Text,
    775         s60Color(QS60StyleEnums::CL_QsnTextColors, 27, 0));
    776     widgetPalette.setColor(QPalette::HighlightedText,
    777         s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0));
    778818    QApplication::setPalette(widgetPalette, "QTextEdit");
    779819    widgetPalette = *palette;
     
    785825
    786826    widgetPalette.setColor(QPalette::WindowText, s60Color(QS60StyleEnums::CL_QsnTextColors, 7, 0));
     827    widgetPalette.setColor(QPalette::HighlightedText,
     828        s60Color(QS60StyleEnums::CL_QsnTextColors, 11, 0));
    787829    QApplication::setPalette(widgetPalette, "QRadioButton");
    788830    QApplication::setPalette(widgetPalette, "QCheckBox");
     
    805847    webPalette.setColor(QPalette::WindowText, Qt::black);
    806848    webPalette.setColor(QPalette::Text, Qt::black);
     849    webPalette.setBrush(QPalette::Base, Qt::white);
     850
    807851    QApplication::setPalette(webPalette, "QWebView");
    808852    QApplication::setPalette(webPalette, "QGraphicsWebView");
     853
     854    m_webPaletteKey = webPalette.cacheKey();
    809855}
    810856
     
    831877        case QS60StyleEnums::SP_QgnGrafNsliderEndRight:
    832878        case QS60StyleEnums::SP_QgnGrafNsliderMiddle:
    833             result.setWidth(result.height() >> 1);
    834879            break;
    835880
     
    842887        case QS60StyleEnums::SP_QgnGrafBarFrameSideL:
    843888        case QS60StyleEnums::SP_QgnGrafBarFrameSideR:
    844             result.setWidth(pixelMetric(PM_Custom_FrameCornerWidth));
    845             break;
    846 
    847         case QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed:
     889            result.setWidth(pixelMetric(PM_FrameCornerWidth));
     890            break;
     891
    848892        case QS60StyleEnums::SP_QsnCpScrollHandleTopPressed:
    849         case QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed:
    850893        case QS60StyleEnums::SP_QsnCpScrollBgBottom:
    851         case QS60StyleEnums::SP_QsnCpScrollBgMiddle:
    852894        case QS60StyleEnums::SP_QsnCpScrollBgTop:
    853895        case QS60StyleEnums::SP_QsnCpScrollHandleBottom:
     896        case QS60StyleEnums::SP_QsnCpScrollHandleTop:
     897        case QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed:
     898            result.setHeight(pixelMetric(QStyle::PM_ScrollBarExtent));
     899            result.setWidth(pixelMetric(QStyle::PM_ScrollBarExtent));
     900            break;
     901        case QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed:
     902        case QS60StyleEnums::SP_QsnCpScrollBgMiddle:
    854903        case QS60StyleEnums::SP_QsnCpScrollHandleMiddle:
    855         case QS60StyleEnums::SP_QsnCpScrollHandleTop:
    856904            result.setHeight(pixelMetric(QStyle::PM_ScrollBarExtent));
    857905            result.setWidth(pixelMetric(QStyle::PM_ScrollBarSliderMin));
     
    866914                    case 6: /* CornerBl */
    867915                    case 5: /* CornerBr */
    868                         result.setWidth(pixelMetric(PM_Custom_FrameCornerWidth));
     916                        result.setWidth(pixelMetric(PM_FrameCornerWidth));
    869917                        // Falltrough intended...
    870918                    case 4: /* SideT */
    871919                    case 3: /* SideB */
    872                         result.setHeight(pixelMetric(PM_Custom_FrameCornerHeight));
     920                        result.setHeight(pixelMetric(PM_FrameCornerHeight));
    873921                        break;
    874922                    case 2: /* SideL */
    875923                    case 1: /* SideR */
    876                         result.setWidth(pixelMetric(PM_Custom_FrameCornerWidth));
     924                        result.setWidth(pixelMetric(PM_FrameCornerWidth));
    877925                        break;
    878926                    case 0: /* center */
     
    891939}
    892940
    893 bool QS60StylePrivate::canDrawThemeBackground(const QBrush &backgroundBrush)
    894 {
     941bool QS60StylePrivate::canDrawThemeBackground(const QBrush &backgroundBrush, const QWidget *widget)
     942{
     943    // Always return true for web pages.
     944    if (widget && m_webPaletteKey == QApplication::palette(widget).cacheKey())
     945        return true;
    895946    //If brush is not changed from style's default values, draw theme graphics.
    896947    return (backgroundBrush.color() == Qt::transparent ||
    897948            backgroundBrush.style() == Qt::NoBrush) ? true : false;
     949}
     950
     951bool QS60StylePrivate::isWidgetPressed(const QWidget *widget)
     952{
     953    return (widget && widget == m_pressedWidget);
    898954}
    899955
     
    936992            QS60StylePrivate::drawSkinElement(grooveElement, painter, grooveRect, flags);
    937993
    938             const QStyle::SubControls subControls = optionSlider->subControls;
     994            const SubControls subControls = optionSlider->subControls;
    939995
    940996            // select correct slider (horizontal/vertical/pressed)
    941             const bool sliderPressed = ((optionSlider->state & QStyle::State_Sunken) && (subControls & SC_ScrollBarSlider));
     997            const bool sliderPressed = ((optionSlider->state & State_Sunken) && (subControls & SC_ScrollBarSlider));
    942998            const QS60StylePrivate::SkinElements handleElement =
    943999                horizontal ?
     
    9601016
    9611017            //Highlight
    962 /*            if (optionSlider->state & QStyle::State_HasFocus)
     1018/*            if (optionSlider->state & State_HasFocus)
    9631019                drawPrimitive(PE_FrameFocusRect, optionSlider, painter, widget);*/
    9641020
     
    9701026                QS60StylePrivate::drawSkinElement(grooveElement, painter, sliderGroove, flags);
    9711027            } else {
    972                 const QRect sliderGroove = subControlRect(control, optionSlider, SC_SliderGroove, widget);
    9731028                const QPoint sliderGrooveCenter = sliderGroove.center();
    9741029                const bool horizontal = optionSlider->orientation == Qt::Horizontal;
     
    9861041            const QRect sliderHandle = subControlRect(control, optionSlider, SC_SliderHandle, widget);
    9871042            QS60StylePrivate::SkinElements handleElement;
    988             if (optionSlider->state & QStyle::State_Sunken)
     1043            if (optionSlider->state & State_Sunken)
    9891044                handleElement =
    9901045                        horizontal ? QS60StylePrivate::SE_SliderHandleSelectedHorizontal : QS60StylePrivate::SE_SliderHandleSelectedVertical;
     
    10611116                    tool.state = bflags;
    10621117                    const QToolButton *toolButtonWidget = qobject_cast<const QToolButton *>(widget);
    1063                     QS60StylePrivate::SkinElements element;
    1064                     if (toolButtonWidget)
    1065                         element = (toolButtonWidget->isDown()) ? QS60StylePrivate::SE_ToolBarButtonPressed : QS60StylePrivate::SE_ToolBarButton;
    1066                     else
    1067                         element = (option->state & State_Sunken) ? QS60StylePrivate::SE_ToolBarButtonPressed : QS60StylePrivate::SE_ToolBarButton;
     1118                    const QS60StylePrivate::SkinElements element =
     1119                        ((toolButtonWidget && toolButtonWidget->isDown()) || (option->state & State_Sunken)) ?
     1120                            QS60StylePrivate::SE_ToolBarButtonPressed : QS60StylePrivate::SE_ToolBarButton;
    10681121                    QS60StylePrivate::drawSkinElement(element, painter, tool.rect, flags);
    10691122                    drawPrimitive(PE_PanelButtonTool, &tool, painter, widget);
     
    10971150            }
    10981151
    1099             if (toolBtn->text.length()>0 ||
     1152            if (toolBtn->text.length() > 0 ||
    11001153                !toolBtn->icon.isNull()) {
    11011154                const int frameWidth = pixelMetric(PM_DefaultFrameWidth, option, widget);
     
    11731226            const QRect textRect = subControlRect(CC_GroupBox, option, SC_GroupBoxLabel, widget);
    11741227            const QRect checkBoxRect = subControlRect(CC_GroupBox, option, SC_GroupBoxCheckBox, widget);
    1175             if (groupBox->subControls & QStyle::SC_GroupBoxFrame) {
     1228            if (groupBox->subControls & SC_GroupBoxFrame) {
    11761229                QStyleOptionFrameV2 frame;
    11771230                frame.QStyleOption::operator=(*groupBox);
     
    11841237
    11851238            // Draw title
    1186             if ((groupBox->subControls & QStyle::SC_GroupBoxLabel) && !groupBox->text.isEmpty()) {
     1239            if ((groupBox->subControls & SC_GroupBoxLabel) && !groupBox->text.isEmpty()) {
    11871240                const QColor textColor = groupBox->textColor;
    11881241                painter->save();
     
    11911244                    painter->setPen(textColor);
    11921245                int alignment = int(groupBox->textAlignment);
    1193                 if (!styleHint(QStyle::SH_UnderlineShortcut, option, widget))
     1246                if (!styleHint(SH_UnderlineShortcut, option, widget))
    11941247                    alignment |= Qt::TextHideMnemonic;
    11951248
     
    12271280            if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option)) {
    12281281                bool isRadio = (element == CE_RadioButton);
     1282                QStyleOptionButton subopt = *btn;
     1283
    12291284                // Highlight needs to be drawn first, as it goes "underneath" the text and indicator.
    12301285                if (btn->state & State_HasFocus) {
     
    12341289                                                        : SE_CheckBoxFocusRect, btn, widget);
    12351290                    drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget);
     1291
     1292                    subopt.palette.setColor(QPalette::Active, QPalette::WindowText,
     1293                        subopt.palette.highlightedText().color());
    12361294                }
    1237                 QStyleOptionButton subopt = *btn;
    12381295
    12391296                subopt.rect = subElementRect(isRadio ? SE_RadioButtonIndicator
     
    12601317    case CE_PushButtonBevel:
    12611318        if (const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(option)) {
    1262             const bool isDisabled = !(option->state & QStyle::State_Enabled);
     1319            const bool isDisabled = !(option->state & State_Enabled);
    12631320            const bool isFlat = button->features & QStyleOptionButton::Flat;
    12641321            QS60StyleEnums::SkinParts skinPart;
    12651322            QS60StylePrivate::SkinElements skinElement;
    12661323            if (!isDisabled) {
    1267                 const bool isPressed = (option->state & QStyle::State_Sunken) ||
    1268                                        (option->state & QStyle::State_On);
     1324                const bool isPressed = (option->state & State_Sunken) ||
     1325                                       (option->state & State_On);
    12691326                if (isFlat) {
    12701327                    skinPart =
     
    12911348            QStyleOptionToolButton optionToolButton = *toolBtn;
    12921349
    1293             if (!optionToolButton.icon.isNull() && (optionToolButton.state & QStyle::State_Sunken)
     1350            if (!optionToolButton.icon.isNull() && (optionToolButton.state & State_Sunken)
    12941351                    && (optionToolButton.state & State_Enabled)) {
    12951352
     
    13131370                optionComboBox.palette.text().color() );
    13141371            QRect editRect = subControlRect(CC_ComboBox, comboBox, SC_ComboBoxEditField, widget);
    1315             painter->save();
    1316             painter->setClipRect(editRect);
     1372            const int frameW = proxy()->pixelMetric(PM_DefaultFrameWidth, option, widget);
    13171373
    13181374            if (!comboBox->currentIcon.isNull()) {
    1319                 QIcon::Mode mode = comboBox->state & State_Enabled ? QIcon::Normal : QIcon::Disabled;
    1320                 QPixmap pixmap = comboBox->currentIcon.pixmap(comboBox->iconSize, mode);
     1375                const QIcon::Mode mode = comboBox->state & State_Enabled ? QIcon::Normal : QIcon::Disabled;
     1376                const QPixmap pixmap = comboBox->currentIcon.pixmap(comboBox->iconSize, mode);
    13211377                QRect iconRect(editRect);
    1322                 iconRect.setWidth(comboBox->iconSize.width() + 4);
     1378                iconRect.setWidth(comboBox->iconSize.width() + frameW);
    13231379                iconRect = alignedRect(comboBox->direction,
    13241380                                       Qt::AlignLeft | Qt::AlignVCenter,
     
    13291385
    13301386                if (comboBox->direction == Qt::RightToLeft)
    1331                     editRect.translate(-4 - comboBox->iconSize.width(), 0);
     1387                    editRect.setRight(editRect.right() - frameW - comboBox->iconSize.width());
    13321388                else
    1333                     editRect.translate(comboBox->iconSize.width() + 4, 0);
     1389                    editRect.setLeft(comboBox->iconSize.width() + frameW);
    13341390            }
    13351391            if (!comboBox->currentText.isEmpty() && !comboBox->editable) {
     1392                const Qt::TextElideMode elideMode = (comboBox->direction == Qt::LeftToRight) ? Qt::ElideRight : Qt::ElideLeft;
     1393                const QString text = comboBox->fontMetrics.elidedText(comboBox->currentText, elideMode, editRect.width());
     1394
    13361395                QCommonStyle::drawItemText(painter,
    1337                             editRect.adjusted(QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth), 0, -1, 0),
     1396                            editRect.adjusted(QS60StylePrivate::pixelMetric(PM_FrameCornerWidth), 0, -1, 0),
    13381397                            visualAlignment(comboBox->direction, Qt::AlignLeft | Qt::AlignVCenter),
    1339                             comboBox->palette, comboBox->state & State_Enabled, comboBox->currentText);
    1340             }
    1341             painter->restore();
     1398                            comboBox->palette, comboBox->state & State_Enabled, text);
     1399            }
    13421400        }
    13431401        break;
     
    13501408
    13511409            painter->setClipRect(voptAdj.rect);
    1352             const bool isSelected = (vopt->state & QStyle::State_Selected);
    1353             const bool hasFocus = (vopt->state & QStyle::State_HasFocus);
     1410            const bool isSelected = (vopt->state & State_Selected);
     1411            const bool hasFocus = (vopt->state & State_HasFocus);
    13541412
    13551413            bool isScrollBarVisible = false;
     
    13801438            if (vopt->backgroundBrush == Qt::NoBrush) {
    13811439                if (itemView) {
    1382                     const QModelIndex index = vopt->index;
    1383                     //todo: Draw cell background only once - for the first cell.
    1384                     QStyleOptionViewItemV4 voptAdj2 = voptAdj;
    1385                     const QModelIndex indexFirst = itemView->model()->index(0, 0);
    1386                     const QModelIndex indexLast = itemView->model()->index(
    1387                             itemView->model()->rowCount() - 1, itemView->model()->columnCount() -1);
    1388                     if (itemView->viewport())
    1389                         voptAdj2.rect = QRect( itemView->visualRect(indexFirst).topLeft(),
    1390                                 itemView->visualRect(indexLast).bottomRight()).intersect(itemView->viewport()->rect());
    13911440                    drawPrimitive(PE_PanelItemViewItem, &voptAdj, painter, widget);
    13921441                }
    13931442            } else { QCommonStyle::drawPrimitive(PE_PanelItemViewItem, &voptAdj, painter, widget);}
    13941443
    1395             // draw the focus rect
    1396             if (isSelected | hasFocus) {
    1397                 QRect highlightRect = option->rect.adjusted(1,1,-1,-1);
    1398                 QAbstractItemView::SelectionBehavior selectionBehavior =
    1399                     itemView ? itemView->selectionBehavior() : QAbstractItemView::SelectItems;
    1400                 if (selectionBehavior != QAbstractItemView::SelectItems) {
    1401                     // set highlight rect so that it is continuous from cell to cell, yet sligthly
    1402                     // smaller than cell rect
    1403                     int xBeginning = 0, yBeginning = 0, xEnd = 0, yEnd = 0;
    1404                     if (selectionBehavior == QAbstractItemView::SelectRows) {
    1405                         yBeginning = 1; yEnd = -1;
    1406                         if (vopt->viewItemPosition == QStyleOptionViewItemV4::Beginning)
    1407                             xBeginning = 1;
    1408                         else if (vopt->viewItemPosition == QStyleOptionViewItemV4::End)
    1409                             xEnd = -1;
    1410                     } else if (selectionBehavior == QAbstractItemView::SelectColumns) {
    1411                         xBeginning = 1; xEnd = -1;
    1412                         if (vopt->viewItemPosition == QStyleOptionViewItemV4::Beginning)
    1413                             yBeginning = 1;
    1414                         else if (vopt->viewItemPosition == QStyleOptionViewItemV4::End)
    1415                             yEnd = -1;
    1416                     }
    1417                     highlightRect = option->rect.adjusted(xBeginning, yBeginning, xEnd, yEnd);
    1418                 }
    1419                 if (vopt->showDecorationSelected &&
    1420                     (vopt->palette.highlight().color() == QS60StylePrivate::themePalette()->highlight().color()))
    1421                     QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ListHighlight, painter, highlightRect, flags);
    1422                 else
    1423                     painter->fillRect(highlightRect, vopt->palette.highlight());
    1424             }
    1425 
    14261444             // draw the icon
    1427              const QIcon::Mode mode = (voptAdj.state & QStyle::State_Enabled) ? QIcon::Normal : QIcon::Disabled;
    1428              const QIcon::State state = voptAdj.state & QStyle::State_Open ? QIcon::On : QIcon::Off;
     1445             const QIcon::Mode mode = (voptAdj.state & State_Enabled) ? QIcon::Normal : QIcon::Disabled;
     1446             const QIcon::State state = (voptAdj.state & State_Open) ? QIcon::On : QIcon::Off;
    14291447             voptAdj.icon.paint(painter, iconRect, voptAdj.decorationAlignment, mode, state);
    14301448
     
    14331451                 const bool singleSelection =
    14341452                     (itemView->selectionMode() == QAbstractItemView::SingleSelection ||
    1435                       itemView->selectionMode() == QAbstractItemView::NoSelection);
     1453                      itemView->selectionMode() == QAbstractItemView::NoSelection)||
     1454                     (itemView->selectionModel()->selectedIndexes().count() < 2 );
     1455
     1456                 const bool selectItemsOnly = (itemView->selectionBehavior() == QAbstractItemView::SelectItems);
     1457
    14361458                 const QRect selectionRect = subElementRect(SE_ItemViewItemCheckIndicator, &voptAdj, widget);
    14371459
    14381460                 QStyleOptionViewItemV4 checkMarkOption(voptAdj);
     1461                 if (selectionRect.isValid())
     1462                     checkMarkOption.rect = selectionRect;
    14391463                 // Draw selection mark.
    1440                  if (voptAdj.state & QStyle::State_Selected && !singleSelection) {
    1441                      checkMarkOption.rect = selectionRect;
    1442                      drawPrimitive(QStyle::PE_IndicatorViewItemCheck, &checkMarkOption, painter, widget);
    1443                      if ( textRect.right() > selectionRect.left() )
     1464                 if (isSelected && !singleSelection && selectItemsOnly) {
     1465                     proxy()->drawPrimitive(PE_IndicatorViewItemCheck, &checkMarkOption, painter, widget);
     1466                     // @todo: this should happen in the rect retrievel i.e. subElementRect()
     1467                     if (textRect.right() > selectionRect.left())
    14441468                         textRect.setRight(selectionRect.left());
    14451469                 } else if (singleSelection &&
    1446                      voptAdj.features & QStyleOptionViewItemV2::HasCheckIndicator &&
    1447                      selectionRect.isValid()) {
    1448                      checkMarkOption.rect = selectionRect;
    1449                      checkMarkOption.state = checkMarkOption.state & ~QStyle::State_HasFocus;
     1470                     voptAdj.features & QStyleOptionViewItemV2::HasCheckIndicator) {
     1471                     checkMarkOption.state = checkMarkOption.state & ~State_HasFocus;
    14501472
    14511473                     switch (vopt->checkState) {
    14521474                     case Qt::Unchecked:
    1453                          checkMarkOption.state |= QStyle::State_Off;
     1475                         checkMarkOption.state |= State_Off;
    14541476                         break;
    14551477                     case Qt::PartiallyChecked:
    1456                          checkMarkOption.state |= QStyle::State_NoChange;
     1478                         checkMarkOption.state |= State_NoChange;
    14571479                         break;
    14581480                     case Qt::Checked:
    1459                          checkMarkOption.state |= QStyle::State_On;
     1481                         checkMarkOption.state |= State_On;
    14601482                         break;
    14611483                     }
    1462                      drawPrimitive(QStyle::PE_IndicatorViewItemCheck, &checkMarkOption, painter, widget);
     1484                     drawPrimitive(PE_IndicatorViewItemCheck, &checkMarkOption, painter, widget);
    14631485                 }
    14641486             }
     
    14661488             // draw the text
    14671489            if (!voptAdj.text.isEmpty()) {
    1468                 if (isSelected) {
    1469                     if (qobject_cast<const QTableView *>(widget))
    1470                         voptAdj.palette.setColor(
    1471                             QPalette::Text, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 11, 0));
    1472                     else
    1473                         voptAdj.palette.setColor(
    1474                             QPalette::Text, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 10, 0));
    1475                 }
    1476                 painter->setPen(voptAdj.palette.text().color());
     1490                if (isSelected || hasFocus )
     1491                    painter->setPen(voptAdj.palette.highlightedText().color());
     1492                else
     1493                    painter->setPen(voptAdj.palette.text().color());
    14771494                d->viewItemDrawText(painter, &voptAdj, textRect);
    14781495            }
     
    14851502        if (const QStyleOptionTabV3 *optionTab = qstyleoption_cast<const QStyleOptionTabV3 *>(option)) {
    14861503            QStyleOptionTabV3 optionTabAdj = *optionTab;
    1487             const bool isSelected = optionTab->state & QStyle::State_Selected;
     1504            const bool isSelected = optionTab->state & State_Selected;
    14881505            const bool directionMirrored = (optionTab->direction == Qt::RightToLeft);
    14891506            QS60StylePrivate::SkinElements skinElement;
     
    15111528                    break;
    15121529            }
    1513             if (skinElement==QS60StylePrivate::SE_TabBarTabEastInactive||
    1514                     skinElement==QS60StylePrivate::SE_TabBarTabNorthInactive||
    1515                     skinElement==QS60StylePrivate::SE_TabBarTabSouthInactive||
    1516                     skinElement==QS60StylePrivate::SE_TabBarTabWestInactive||
    1517                     skinElement==QS60StylePrivate::SE_TabBarTabEastActive||
    1518                     skinElement==QS60StylePrivate::SE_TabBarTabNorthActive||
    1519                     skinElement==QS60StylePrivate::SE_TabBarTabSouthActive||
     1530            if (skinElement == QS60StylePrivate::SE_TabBarTabEastInactive ||
     1531                    skinElement == QS60StylePrivate::SE_TabBarTabNorthInactive ||
     1532                    skinElement == QS60StylePrivate::SE_TabBarTabSouthInactive ||
     1533                    skinElement == QS60StylePrivate::SE_TabBarTabWestInactive ||
     1534                    skinElement == QS60StylePrivate::SE_TabBarTabEastActive ||
     1535                    skinElement == QS60StylePrivate::SE_TabBarTabNorthActive ||
     1536                    skinElement == QS60StylePrivate::SE_TabBarTabSouthActive ||
    15201537                    skinElement==QS60StylePrivate::SE_TabBarTabWestActive) {
    15211538                const int borderThickness =
    1522                     QS60StylePrivate::pixelMetric(QStyle::PM_DefaultFrameWidth);
     1539                    QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth);
    15231540                const int tabOverlap =
    1524                     QS60StylePrivate::pixelMetric(QStyle::PM_TabBarTabOverlap) - borderThickness;
    1525                 //todo: draw navi wipe behind tabbar - must be drawn with first draw
    1526 
    1527                 if (skinElement==QS60StylePrivate::SE_TabBarTabEastInactive||
    1528                         skinElement==QS60StylePrivate::SE_TabBarTabEastActive||
    1529                         skinElement==QS60StylePrivate::SE_TabBarTabWestInactive||
    1530                         skinElement==QS60StylePrivate::SE_TabBarTabWestActive){
    1531                     optionTabAdj.rect.adjust(0, 0, 0, tabOverlap);
     1541                    QS60StylePrivate::pixelMetric(PM_TabBarTabOverlap) - borderThickness;
     1542                const bool usesScrollButtons =
     1543                    (widget) ? (qobject_cast<const QTabBar*>(widget))->usesScrollButtons() : false;
     1544                const int roomForScrollButton =
     1545                    usesScrollButtons ? QS60StylePrivate::pixelMetric(PM_TabBarScrollButtonWidth) : 0;
     1546
     1547                // adjust for overlapping tabs and scrollbuttons, if necessary
     1548                if (skinElement == QS60StylePrivate::SE_TabBarTabEastInactive ||
     1549                        skinElement == QS60StylePrivate::SE_TabBarTabEastActive ||
     1550                        skinElement == QS60StylePrivate::SE_TabBarTabWestInactive ||
     1551                        skinElement == QS60StylePrivate::SE_TabBarTabWestActive){
     1552                    if (optionTabAdj.position == QStyleOptionTabV3::Beginning)
     1553                        optionTabAdj.rect.adjust(0, roomForScrollButton, 0, tabOverlap);
     1554                    else if (optionTabAdj.position == QStyleOptionTabV3::End)
     1555                        optionTabAdj.rect.adjust(0, 0, 0, tabOverlap);
     1556                    else
     1557                        optionTabAdj.rect.adjust(0, 0, 0, tabOverlap);
    15321558                } else {
    1533                     if (directionMirrored)
    1534                         optionTabAdj.rect.adjust(-tabOverlap, 0, 0, 0);
    1535                     else
    1536                         optionTabAdj.rect.adjust(0, 0, tabOverlap, 0);
     1559                    if (directionMirrored) {
     1560                        if (optionTabAdj.position == QStyleOptionTabV3::Beginning)
     1561                            optionTabAdj.rect.adjust(-tabOverlap, 0, -roomForScrollButton, 0);
     1562                        else
     1563                            optionTabAdj.rect.adjust(-tabOverlap, 0, 0, 0);
     1564                    } else {
     1565                        if (optionTabAdj.position == QStyleOptionTabV3::Beginning)
     1566                            optionTabAdj.rect.adjust(roomForScrollButton, 0, tabOverlap, 0);
     1567                        else
     1568                            optionTabAdj.rect.adjust(0, 0, tabOverlap, 0);
    15371569                    }
     1570                }
    15381571            }
    15391572            QS60StylePrivate::drawSkinElement(skinElement, painter, optionTabAdj.rect, flags);
     
    15451578            QRect tr = optionTab.rect;
    15461579            const bool directionMirrored = (optionTab.direction == Qt::RightToLeft);
    1547             const int borderThickness = QS60StylePrivate::pixelMetric(QStyle::PM_DefaultFrameWidth);
     1580            const int borderThickness = QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth);
    15481581            const int tabOverlap =
    1549                 QS60StylePrivate::pixelMetric(QStyle::PM_TabBarTabOverlap) - borderThickness;
    1550             const QRect windowRect = painter->window();
     1582                QS60StylePrivate::pixelMetric(PM_TabBarTabOverlap) - borderThickness;
     1583            const bool usesScrollButtons =
     1584                (widget) ? (qobject_cast<const QTabBar*>(widget))->usesScrollButtons() : false;
     1585            const int roomForScrollButton =
     1586                usesScrollButtons ? QS60StylePrivate::pixelMetric(PM_TabBarScrollButtonWidth) : 0;
    15511587
    15521588            switch (tab->shape) {
     
    15761612            if (selected)
    15771613                optionTab.palette.setColor(QPalette::Active, QPalette::WindowText,
    1578                     QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 3, option));
     1614                    optionTab.palette.highlightedText().color());
    15791615
    15801616            const bool verticalTabs = optionTab.shape == QTabBar::RoundedEast
     
    15821618                                || optionTab.shape == QTabBar::TriangularEast
    15831619                                || optionTab.shape == QTabBar::TriangularWest;
     1620
     1621            //make room for scrollbuttons
     1622            if (!verticalTabs) {
     1623                if ((tab->position == QStyleOptionTabV3::Beginning && !directionMirrored))
     1624                    tr.adjust(roomForScrollButton, 0, 0, 0);
     1625                else if ((tab->position == QStyleOptionTabV3::Beginning && directionMirrored))
     1626                    tr.adjust(0, 0, -roomForScrollButton, 0);
     1627            } else {
     1628                if (tab->position == QStyleOptionTabV3::Beginning)
     1629                    tr.adjust(0, roomForScrollButton, 0, 0);
     1630            }
    15841631
    15851632            if (verticalTabs) {
     
    16011648                painter->setTransform(m, true);
    16021649            }
    1603             tr.adjust(0, 0, pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, tab, widget),
    1604                             pixelMetric(QStyle::PM_TabBarTabShiftVertical, tab, widget));
     1650            tr.adjust(0, 0, pixelMetric(PM_TabBarTabShiftHorizontal, tab, widget),
     1651                            pixelMetric(PM_TabBarTabShiftVertical, tab, widget));
    16051652
    16061653            if (selected) {
    1607                 tr.setBottom(tr.bottom() - pixelMetric(QStyle::PM_TabBarTabShiftVertical, tab, widget));
    1608                 tr.setRight(tr.right() - pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, tab, widget));
     1654                tr.setBottom(tr.bottom() - pixelMetric(PM_TabBarTabShiftVertical, tab, widget));
     1655                tr.setRight(tr.right() - pixelMetric(PM_TabBarTabShiftHorizontal, tab, widget));
    16091656            }
    16101657
     
    16141661            if (!optionTab.icon.isNull()) {
    16151662                QSize iconSize = optionTab.iconSize;
    1616                 int iconExtent = pixelMetric(PM_TabBarIconSize);
    1617                 if (iconSize.height() > iconExtent || iconSize.width() > iconExtent)
     1663                if (!iconSize.isValid()) {
     1664                    const int iconExtent = pixelMetric(PM_TabBarIconSize);
    16181665                    iconSize = QSize(iconExtent, iconExtent);
     1666                }
    16191667                QPixmap tabIcon = optionTab.icon.pixmap(iconSize,
    16201668                    (optionTab.state & State_Enabled) ? QIcon::Normal : QIcon::Disabled);
     
    16271675                                        tr.center().y() - (tabIcon.height() >> 1),
    16281676                                        tabIcon);
    1629                 tr.setLeft(tr.left() + iconSize.width() + 4);
     1677                tr.setLeft(tr.left() + iconSize.width() + 4); //todo: magic four
    16301678            }
    16311679
     
    17091757                text_flags |= Qt::TextHideMnemonic;
    17101758
    1711             if ((option->state & State_Selected) && (option->state & State_Enabled))
     1759            const bool selected = (option->state & State_Selected) && (option->state & State_Enabled);
     1760            if (selected)
    17121761                QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ListHighlight, painter, option->rect, flags);
    17131762
     
    17161765
    17171766            //todo: move the vertical spacing stuff into subElementRect
    1718             const int vSpacing = QS60StylePrivate::pixelMetric(QStyle::PM_LayoutVerticalSpacing);
     1767            const int vSpacing = QS60StylePrivate::pixelMetric(PM_LayoutVerticalSpacing);
    17191768            if (checkable){
    1720                 const int hSpacing = QS60StylePrivate::pixelMetric(QStyle::PM_LayoutHorizontalSpacing);
     1769                const int hSpacing = QS60StylePrivate::pixelMetric(PM_LayoutHorizontalSpacing);
    17211770                QStyleOptionMenuItem optionCheckBox;
    17221771                optionCheckBox.QStyleOptionMenuItem::operator=(*menuItem);
    17231772                optionCheckBox.rect.setWidth(pixelMetric(PM_IndicatorWidth));
    17241773                optionCheckBox.rect.setHeight(pixelMetric(PM_IndicatorHeight));
     1774                optionCheckBox.rect.moveCenter(QPoint(
     1775                        optionCheckBox.rect.center().x(),
     1776                        menuItem->rect.center().y()));
    17251777                const int moveByX = optionCheckBox.rect.width() + vSpacing;
    17261778                if (optionMenuItem.direction == Qt::LeftToRight) {
     
    17561808                arrowOptions.QStyleOption::operator=(*menuItem);
    17571809                const int indicatorWidth = (pixelMetric(PM_ListViewIconSize, option, widget) >> 1) +
    1758                     pixelMetric(QStyle::PM_LayoutVerticalSpacing, option, widget);
     1810                    pixelMetric(PM_LayoutVerticalSpacing, option, widget);
    17591811                if (optionMenuItem.direction == Qt::LeftToRight)
    17601812                    arrowOptions.rect.setLeft(textRect.right());
     
    17791831                painter->setOpacity(0.5);
    17801832            }
     1833            if (selected)
     1834                optionMenuItem.palette.setColor(
     1835                    QPalette::Active, QPalette::Text, optionMenuItem.palette.highlightedText().color());
     1836
    17811837            QCommonStyle::drawItemText(painter, textRect, text_flags,
    17821838                    optionMenuItem.palette, enabled,
     
    18001856            QPen linePen = QPen(QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors, 1, header));
    18011857            const int penWidth = (header->orientation == Qt::Horizontal) ?
    1802                 linePen.width() + QS60StylePrivate::pixelMetric(PM_Custom_BoldLineWidth)
    1803                 : linePen.width() + QS60StylePrivate::pixelMetric(PM_Custom_ThinLineWidth);
     1858                linePen.width() + QS60StylePrivate::pixelMetric(PM_BoldLineWidth)
     1859                : linePen.width() + QS60StylePrivate::pixelMetric(PM_ThinLineWidth);
    18041860            linePen.setWidth(penWidth);
    18051861            painter->setPen(linePen);
     
    18201876                QStyleOptionHeader subopt = *header;
    18211877                const int borderTweak =
    1822                     QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth) >> 1;
     1878                    QS60StylePrivate::pixelMetric(PM_FrameCornerWidth) >> 1;
    18231879                if (subopt.direction == Qt::LeftToRight)
    18241880                    subopt.rect.adjust(borderTweak, borderTweak, 0, -borderTweak);
     
    18961952        if (const QTextEdit *textEdit = qobject_cast<const QTextEdit *>(widget)) {
    18971953            const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(option);
    1898             if (QS60StylePrivate::canDrawThemeBackground(frame->palette.base()))
     1954            if (QS60StylePrivate::canDrawThemeBackground(frame->palette.base(), widget))
    18991955                QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_Editor, painter, option->rect, flags);
    19001956            else
     
    19281984        break;
    19291985    case CE_FocusFrame: {
    1930             // The pen width should nearly fill the layoutspacings around the widget
    1931             const int penWidth =
    1932                 qMin(pixelMetric(QS60Style::PM_LayoutVerticalSpacing), pixelMetric(QS60Style::PM_LayoutHorizontalSpacing))
    1933                 - 2; // But keep 1 pixel distance to the focus widget and 1 pixel to the adjacent widgets
    1934 
    19351986#ifdef QT_KEYPAD_NAVIGATION
    19361987            bool editFocus = false;
     
    19391990                    editFocus = true;
    19401991            }
    1941             const qreal opacity = editFocus ? 0.65 : 0.45; // Trial and error factors. Feel free to improve.
     1992            const qreal opacity = editFocus ? 1 : 0.75; // Trial and error factors. Feel free to improve.
    19421993#else
    1943             const qreal opacity = 0.5;
     1994            const qreal opacity = 0.85;
    19441995#endif
    1945             // Because of Qts coordinate system, we need to tweak the rect by .5 pixels, otherwise it gets blurred.
    1946             const qreal rectAdjustment = (penWidth % 2) ? -.5 : 0;
    1947 
    1948             // Make sure that the pen stroke is inside the rect
    1949             const QRectF adjustedRect =
    1950                 QRectF(option->rect).adjusted(
    1951                     rectAdjustment + penWidth,
    1952                     rectAdjustment + penWidth,
    1953                     -rectAdjustment - penWidth,
    1954                     -rectAdjustment - penWidth
    1955                 );
    1956 
    1957             const qreal roundRectRadius = penWidth * goldenRatio;
     1996            // We need to reduce the focus frame size if LayoutSpacing is smaller than FocusFrameMargin
     1997            // Otherwise, we would overlay adjacent widgets.
     1998            const int frameHeightReduction =
     1999                    qMin(0, pixelMetric(PM_LayoutVerticalSpacing)
     2000                            - pixelMetric(PM_FocusFrameVMargin));
     2001            const int frameWidthReduction =
     2002                    qMin(0, pixelMetric(PM_LayoutHorizontalSpacing)
     2003                            - pixelMetric(PM_FocusFrameHMargin));
     2004            const int rounding =
     2005                    qMin(pixelMetric(PM_FocusFrameVMargin),
     2006                            pixelMetric(PM_LayoutVerticalSpacing));
     2007            const QRect frameRect =
     2008                    option->rect.adjusted(-frameWidthReduction, -frameHeightReduction,
     2009                            frameWidthReduction, frameHeightReduction);
     2010            QPainterPath framePath;
     2011            framePath.addRoundedRect(frameRect, rounding, rounding);
    19582012
    19592013            painter->save();
    19602014            painter->setRenderHint(QPainter::Antialiasing);
    19612015            painter->setOpacity(opacity);
    1962             painter->setPen(QPen(option->palette.color(QPalette::Text), penWidth));
    1963             painter->drawRoundedRect(adjustedRect, roundRectRadius, roundRectRadius);
     2016            painter->fillPath(framePath, option->palette.color(QPalette::Text));
    19642017            painter->restore();
    19652018        }
     
    19862039void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const
    19872040{
    1988     Q_D(const QS60Style);
    19892041    const QS60StylePrivate::SkinElementFlags flags = (option->state & State_Enabled) ?  QS60StylePrivate::SF_StateEnabled : QS60StylePrivate::SF_StateDisabled;
    19902042    bool commonStyleDraws = false;
     
    19942046            //Draw themed highlight to radiobuttons and checkboxes.
    19952047            //For other widgets skip, unless palette has been modified. In that case, draw with commonstyle.
    1996             if (option->palette.highlight().color() == QS60StylePrivate::themePalette()->highlight().color())
     2048            if (option->palette.highlight().color() == QS60StylePrivate::themePalette()->highlight().color()) {
    19972049                if ((qstyleoption_cast<const QStyleOptionFocusRect *>(option) &&
    19982050                    (qobject_cast<const QRadioButton *>(widget) || qobject_cast<const QCheckBox *>(widget))))
    1999                         QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ListHighlight, painter, option->rect, flags);
    2000             else
     2051                        QS60StylePrivate::drawSkinElement(
     2052                            QS60StylePrivate::isWidgetPressed(widget) ?
     2053                                QS60StylePrivate::SE_ListItemPressed :
     2054                                QS60StylePrivate::SE_ListHighlight, painter, option->rect, flags);
     2055            } else {
    20012056                commonStyleDraws = true;
    20022057            }
     2058        }
    20032059        break;
    20042060#ifndef QT_NO_LINEEDIT
     
    20092065                break;
    20102066#endif
    2011             if (QS60StylePrivate::canDrawThemeBackground(option->palette.base()))
     2067            if (QS60StylePrivate::canDrawThemeBackground(option->palette.base(), widget))
    20122068                QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_FrameLineEdit, painter, option->rect, flags);
    20132069            else
     
    20182074    case PE_IndicatorCheckBox: {
    20192075            // Draw checkbox indicator as color skinned graphics.
    2020             const QS60StyleEnums::SkinParts skinPart = (option->state & QStyle::State_On) ?
     2076            const QS60StyleEnums::SkinParts skinPart = (option->state & State_On) ?
    20212077                QS60StyleEnums::SP_QgnIndiCheckboxOn : QS60StyleEnums::SP_QgnIndiCheckboxOff;
    20222078            painter->save();
    20232079
    2024             QColor themeColor = QS60StylePrivate::themePalette()->windowText().color();
    2025             QColor windowTextColor = option->palette.windowText().color();
     2080            const QColor themeColor = QS60StylePrivate::themePalette()->windowText().color();
     2081            const QColor windowTextColor = option->palette.windowText().color();
    20262082
    20272083            if (themeColor != windowTextColor)
     
    20342090    case PE_IndicatorViewItemCheck:
    20352091#ifndef QT_NO_ITEMVIEWS
    2036         if (const QListView *listItem = (qobject_cast<const QListView *>(widget))) {
     2092        if (const QAbstractItemView *itemView = (qobject_cast<const QAbstractItemView *>(widget))) {
    20372093            if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option)) {
    20382094                const bool checkBoxVisible = vopt->features & QStyleOptionViewItemV2::HasCheckIndicator;
    2039                 const bool singleSelection = listItem->selectionMode() ==
    2040                     QAbstractItemView::SingleSelection || listItem->selectionMode() == QAbstractItemView::NoSelection;
     2095                const bool singleSelection = itemView->selectionMode() ==
     2096                    QAbstractItemView::SingleSelection || itemView->selectionMode() == QAbstractItemView::NoSelection;
    20412097                // draw either checkbox at the beginning
    20422098                if (checkBoxVisible && singleSelection) {
    20432099                    drawPrimitive(PE_IndicatorCheckBox, option, painter, widget);
    20442100                // ... or normal "tick" selection at the end.
    2045                 } else if (option->state & QStyle::State_Selected) {
     2101                } else if (option->state & State_Selected) {
    20462102                    QRect tickRect = option->rect;
    2047                     const int frameBorderWidth = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth);
     2103                    const int frameBorderWidth = QS60StylePrivate::pixelMetric(PM_FrameCornerWidth);
    20482104                    // adjust tickmark rect to exclude frame border
    20492105                    tickRect.adjust(0, -frameBorderWidth, 0, -frameBorderWidth);
     
    20702126
    20712127            painter->save();
    2072             QColor themeColor = d->s60Color(QS60StyleEnums::CL_QsnTextColors, 6, option);
    2073             QColor buttonTextColor = option->palette.buttonText().color();
     2128            const QColor themeColor = QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, option);
     2129            const QColor buttonTextColor = option->palette.buttonText().color();
    20742130            if (themeColor != buttonTextColor)
    20752131                painter->setPen(buttonTextColor);
     
    20782134
    20792135            // Draw radiobutton indicator as color skinned graphics.
    2080             QS60StyleEnums::SkinParts skinPart = (option->state & QStyle::State_On) ?
     2136            QS60StyleEnums::SkinParts skinPart = (option->state & State_On) ?
    20812137                QS60StyleEnums::SP_QgnIndiRadiobuttOn : QS60StyleEnums::SP_QgnIndiRadiobuttOff;
    20822138            QS60StylePrivate::drawSkinPart(skinPart, painter, buttonRect,
     
    20892145    case PE_PanelButtonBevel:
    20902146    case PE_FrameButtonBevel:
    2091         if (QS60StylePrivate::canDrawThemeBackground(option->palette.base())) {
    2092             const bool isPressed = option->state & QStyle::State_Sunken;
     2147        if (QS60StylePrivate::canDrawThemeBackground(option->palette.base(), widget)) {
     2148            const bool isPressed = option->state & State_Sunken;
    20932149            const QS60StylePrivate::SkinElements skinElement =
    20942150                isPressed ? QS60StylePrivate::SE_ButtonPressed : QS60StylePrivate::SE_ButtonNormal;
     
    21212177    case PE_IndicatorSpinUp:
    21222178        if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
    2123             if (QS60StylePrivate::canDrawThemeBackground(spinBox->palette.base())) {
     2179            if (QS60StylePrivate::canDrawThemeBackground(spinBox->palette.base(), widget)) {
    21242180                QStyleOptionSpinBox optionSpinBox = *spinBox;
    21252181                const QS60StyleEnums::SkinParts part = (element == PE_IndicatorSpinUp) ?
    21262182                    QS60StyleEnums::SP_QgnGrafScrollArrowUp :
    21272183                    QS60StyleEnums::SP_QgnGrafScrollArrowDown;
    2128                 const int iconMargin = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth) >> 1;
     2184                const int iconMargin = QS60StylePrivate::pixelMetric(PM_FrameCornerWidth) >> 1;
    21292185                optionSpinBox.rect.translate(0, (element == PE_IndicatorSpinDown) ? iconMargin : -iconMargin );
    21302186                QS60StylePrivate::drawSkinPart(part, painter, optionSpinBox.rect, flags);
     
    21362192#ifndef QT_NO_COMBOBOX
    21372193        if (const QStyleOptionFrame *cmb = qstyleoption_cast<const QStyleOptionFrame *>(option)) {
    2138             if (QS60StylePrivate::canDrawThemeBackground( option->palette.base())) {
     2194            if (QS60StylePrivate::canDrawThemeBackground( option->palette.base(), widget)) {
    21392195                // We want to draw down arrow here for comboboxes as well.
    21402196                QStyleOptionFrame optionsComboBox = *cmb;
    21412197                const QS60StyleEnums::SkinParts part = QS60StyleEnums::SP_QgnGrafScrollArrowDown;
    2142                 const int iconMargin = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth) >> 1;
     2198                const int iconMargin = QS60StylePrivate::pixelMetric(PM_FrameCornerWidth) >> 1;
    21432199                optionsComboBox.rect.translate(0, (element == PE_IndicatorSpinDown) ? iconMargin : -iconMargin );
    21442200                QS60StylePrivate::drawSkinPart(part, painter, optionsComboBox.rect, flags);
     
    21752231            ) {
    21762232            //Need extra check since dialogs have their own theme background
    2177             if (QS60StylePrivate::canDrawThemeBackground(option->palette.base()) &&
     2233            if (QS60StylePrivate::canDrawThemeBackground(option->palette.base(), widget) &&
    21782234                option->palette.window().texture().cacheKey() ==
    21792235                    QS60StylePrivate::m_themePalette->window().texture().cacheKey())
    2180                 QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_OptionsMenu, painter, option->rect, flags);
     2236                QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_PopupBackground, painter, option->rect, flags);
    21812237            else
    21822238                commonStyleDraws = true;
     
    22172273#ifndef QT_NO_ITEMVIEWS
    22182274    case PE_PanelItemViewItem:
     2275        if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option)) {
     2276            const bool isSelected = (vopt->state & State_Selected);
     2277            const bool hasFocus = (vopt->state & State_HasFocus);
     2278            const bool isPressed = QS60StylePrivate::isWidgetPressed(widget);
     2279
     2280            if (option->palette.highlight().color() == QS60StylePrivate::themePalette()->highlight().color()) {
     2281                QRect highlightRect = vopt->rect.adjusted(1,1,-1,-1);
     2282                const QAbstractItemView *itemView = qobject_cast<const QAbstractItemView *>(widget);
     2283                QAbstractItemView::SelectionBehavior selectionBehavior =
     2284                    itemView ? itemView->selectionBehavior() : QAbstractItemView::SelectItems;
     2285                // Set the draw area for highlights (focus, select rect or pressed rect)
     2286                if (hasFocus || isSelected || isPressed) {
     2287                    if (selectionBehavior != QAbstractItemView::SelectItems) {
     2288                        // set highlight rect so that it is continuous from cell to cell, yet sligthly
     2289                        // smaller than cell rect
     2290                        int xBeginning = 0, yBeginning = 0, xEnd = 0, yEnd = 0;
     2291                        if (selectionBehavior == QAbstractItemView::SelectRows) {
     2292                            yBeginning = 1; yEnd = -1;
     2293                            if (vopt->viewItemPosition == QStyleOptionViewItemV4::Beginning)
     2294                                xBeginning = 1;
     2295                            else if (vopt->viewItemPosition == QStyleOptionViewItemV4::End)
     2296                                xEnd = -1;
     2297                        } else if (selectionBehavior == QAbstractItemView::SelectColumns) {
     2298                            xBeginning = 1; xEnd = -1;
     2299                            if (vopt->viewItemPosition == QStyleOptionViewItemV4::Beginning)
     2300                                yBeginning = 1;
     2301                            else if (vopt->viewItemPosition == QStyleOptionViewItemV4::End)
     2302                                yEnd = -1;
     2303                        }
     2304                        highlightRect = option->rect.adjusted(xBeginning, yBeginning, xEnd, yEnd);
     2305                    }
     2306                }
     2307                bool tableView = false;
     2308                if (itemView && qobject_cast<const QTableView *>(widget))
     2309                    tableView = true;
     2310
     2311                QS60StylePrivate::SkinElements element;
     2312                QRect elementRect = option->rect;
     2313
     2314                //draw item is drawn as pressed, if it already has focus.
     2315                if (isPressed && (hasFocus || isSelected)) {
     2316                    element = tableView ? QS60StylePrivate::SE_TableItemPressed : QS60StylePrivate::SE_ListItemPressed;
     2317                } else if (hasFocus || (isSelected && selectionBehavior != QAbstractItemView::SelectItems)) {
     2318                    element = QS60StylePrivate::SE_ListHighlight;
     2319                    elementRect = highlightRect;
     2320                }
     2321                QS60StylePrivate::drawSkinElement(element, painter, elementRect, flags);
     2322            } else {
     2323                QCommonStyle::drawPrimitive(element, option, painter, widget);
     2324            }
     2325        }
    22192326        break;
    22202327#endif //QT_NO_ITEMVIEWS
     
    22492356            QCommonStyle::drawPrimitive(element, option, painter, widget);
    22502357        } else {
    2251             const bool rightLine = option->state & State_Item;
    2252             const bool downLine = option->state & State_Sibling;
    2253             const bool upLine = option->state & (State_Open | State_Children | State_Item | State_Sibling);
    2254 
    2255             QS60StyleEnums::SkinParts skinPart;
    2256             bool drawSkinPart = false;
    2257             if (rightLine && downLine && upLine) {
    2258                 skinPart = QS60StyleEnums::SP_QgnIndiHlLineBranch;
    2259                 drawSkinPart = true;
    2260             } else if (rightLine && upLine) {
    2261                 skinPart = QS60StyleEnums::SP_QgnIndiHlLineEnd;
    2262                 drawSkinPart = true;
    2263             } else if (upLine && downLine) {
    2264                 skinPart = QS60StyleEnums::SP_QgnIndiHlLineStraight;
    2265                 drawSkinPart = true;
    2266             }
    2267 
    2268             if (drawSkinPart)
    2269                 QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, flags);
    2270 
    2271             if (option->state & State_Children) {
    2272                 QS60StyleEnums::SkinParts skinPart =
    2273                         (option->state & State_Open) ? QS60StyleEnums::SP_QgnIndiHlColSuper : QS60StyleEnums::SP_QgnIndiHlExpSuper;
    2274                 int minDimension = qMin(option->rect.width(), option->rect.height());
    2275                 const int resizeValue = minDimension >> 1;
    2276                 minDimension += resizeValue; // Adjust the icon bigger because of empty space in svg icon.
    2277                 QRect iconRect(option->rect.topLeft(), QSize(minDimension, minDimension));
    2278                 int verticalMagic(0);
    2279                 // magic values for positioning svg icon.
    2280                 if (option->rect.width() <= option->rect.height())
    2281                     verticalMagic = 3;
    2282                 iconRect.translate(3, verticalMagic - resizeValue);
    2283                 QS60StylePrivate::drawSkinPart(skinPart, painter, iconRect, flags);
     2358            if (const QStyleOptionViewItemV2 *vopt = qstyleoption_cast<const QStyleOptionViewItemV2 *>(option)) {
     2359                const bool rightLine = option->state & State_Item;
     2360                const bool downLine = option->state & State_Sibling;
     2361                const bool upLine = option->state & (State_Open | State_Children | State_Item | State_Sibling);
     2362                QS60StylePrivate::SkinElementFlags adjustedFlags = flags;
     2363
     2364                QS60StyleEnums::SkinParts skinPart;
     2365                bool drawSkinPart = false;
     2366                if (rightLine && downLine && upLine) {
     2367                    skinPart = QS60StyleEnums::SP_QgnIndiHlLineBranch;
     2368                    drawSkinPart = true;
     2369                } else if (rightLine && upLine) {
     2370                    skinPart = QS60StyleEnums::SP_QgnIndiHlLineEnd;
     2371                    drawSkinPart = true;
     2372                } else if (upLine && downLine) {
     2373                    skinPart = QS60StyleEnums::SP_QgnIndiHlLineStraight;
     2374                    drawSkinPart = true;
     2375                }
     2376
     2377                if (option->direction == Qt::RightToLeft)
     2378                    adjustedFlags |= QS60StylePrivate::SF_Mirrored_X_Axis;
     2379
     2380                if (drawSkinPart)
     2381                    QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, adjustedFlags);
     2382
     2383                if (option->state & State_Children) {
     2384                    QS60StyleEnums::SkinParts skinPart =
     2385                            (option->state & State_Open) ? QS60StyleEnums::SP_QgnIndiHlColSuper : QS60StyleEnums::SP_QgnIndiHlExpSuper;
     2386                    const QRect selectionRect = subElementRect(SE_ItemViewItemCheckIndicator, vopt, widget);
     2387                    const int minDimension = qMin(option->rect.width(), option->rect.height());
     2388                    const int magicTweak = (option->direction == Qt::RightToLeft) ? -3 : 3; //@todo: magic
     2389                    //The branch indicator icon in S60 is supposed to be superimposed on top of branch lines.
     2390                    QRect iconRect(QPoint(option->rect.left() + magicTweak, selectionRect.top() + 1), QSize(minDimension, minDimension));
     2391                    if (!QS60StylePrivate::isTouchSupported())
     2392                        iconRect.translate(0, -4); //@todo: magic
     2393                    QS60StylePrivate::drawSkinPart(skinPart, painter, iconRect, adjustedFlags);
     2394                }
    22842395            }
    22852396        }
     
    22922403                commonStyleDraws = true;
    22932404            } else {
    2294                 QPalette::ColorGroup cg = vopt->state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled;
    2295                 if (cg == QPalette::Normal && !(vopt->state & QStyle::State_Active))
     2405                QPalette::ColorGroup cg = vopt->state & State_Enabled ? QPalette::Normal : QPalette::Disabled;
     2406                if (cg == QPalette::Normal && !(vopt->state & State_Active))
    22962407                    cg = QPalette::Inactive;
    22972408                if (vopt->features & QStyleOptionViewItemV2::Alternate)
     
    23042415    case PE_PanelScrollAreaCorner:
    23052416        break;
    2306 
     2417    case PE_IndicatorItemViewItemDrop:
     2418        if (QS60StylePrivate::isTouchSupported())
     2419            QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_DropArea, painter, option->rect, flags);
     2420        else
     2421            commonStyleDraws = true;
     2422        break;
    23072423        // todo: items are below with #ifdefs "just in case". in final version, remove all non-required cases
    23082424    case PE_FrameLineEdit:
     
    23252441#ifndef QT_NO_COLUMNVIEW
    23262442    case PE_IndicatorColumnViewArrow:
    2327     case PE_IndicatorItemViewItemDrop:
    23282443#endif //QT_NO_COLUMNVIEW
    23292444    case PE_FrameTabBarBase: // since tabs are in S60 always in navipane, let's use common style for tab base in Qt.
     
    23432458        metricValue = QCommonStyle::pixelMetric(metric, option, widget);
    23442459
    2345     if (metric == PM_SubMenuOverlap && widget) {
    2346         const QMenu *menu = qobject_cast<const QMenu *>(widget);
    2347         if (menu && menu->activeAction() && menu->activeAction()->menu()) {
    2348             const int menuWidth = menu->activeAction()->menu()->sizeHint().width();
    2349             metricValue = -menuWidth;
    2350         }
    2351     }
     2460    // Menu scrollers should be set to zero height for combobox popups
     2461    if (metric == PM_MenuScrollerHeight && !qobject_cast<const QMenu *>(widget))
     2462        metricValue = 0;
     2463
    23522464    //if layout direction is mirrored, switch left and right border margins
    23532465    if (option && option->direction == Qt::RightToLeft) {
     
    23572469            metricValue = QS60StylePrivate::pixelMetric(PM_LayoutLeftMargin);
    23582470    }
     2471
     2472    if (widget && (metric == PM_LayoutTopMargin))
     2473        if (widget->windowType() == Qt::Dialog)
     2474            //double the top layout margin for dialogs, it is very close to real value
     2475            //without having to define custom pixel metric
     2476            metricValue *= 2;
     2477
     2478    if (widget && (metric == PM_FocusFrameHMargin))
     2479        if (qobject_cast<const QTableView *>(widget))
     2480            //Halve the focus frame margin for table items
     2481            metricValue /= 2;
     2482
    23592483    return metricValue;
    23602484}
     
    23772501            sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
    23782502            //FIXME properly - style should calculate the location of border frame-part
    2379             sz += QSize(2 * pixelMetric(PM_ButtonMargin), 2 * pixelMetric(PM_ButtonMargin));
    2380             if (const QAbstractButton *buttonWidget = (qobject_cast<const QAbstractButton *>(widget)))
     2503            if (const QAbstractButton *buttonWidget = (qobject_cast<const QAbstractButton *>(widget)))  {
    23812504                if (buttonWidget->isCheckable())
    23822505                    sz += QSize(pixelMetric(PM_IndicatorWidth) + pixelMetric(PM_CheckBoxLabelSpacing), 0);
     2506                const int iconHeight = (!buttonWidget->icon().isNull()) ? buttonWidget->iconSize().height() : 0;
     2507                const int textHeight = (buttonWidget->text().length() > 0) ?
     2508                    buttonWidget->fontMetrics().size(Qt::TextSingleLine, buttonWidget->text()).height() : opt->fontMetrics.height();
     2509                const int decoratorHeight = (buttonWidget->isCheckable()) ? pixelMetric(PM_IndicatorHeight) : 0;
     2510
     2511                const int contentHeight =
     2512                        qMax(qMax(iconHeight, decoratorHeight) + pixelMetric(PM_ButtonMargin),
     2513                             textHeight + 2*pixelMetric(PM_ButtonMargin));
     2514                sz.setHeight(qMax(sz.height(), contentHeight));
     2515                sz += QSize(2 * pixelMetric(PM_ButtonMargin), 0);
     2516            }
    23832517            break;
    23842518        case CT_LineEdit:
     
    23912525                if (naviPaneSize.height() > sz.height())
    23922526                    sz.setHeight(naviPaneSize.height());
    2393             }
    2394             break;
     2527                // Adjust beginning tabbar item size, if scrollbuttons are used. This is to ensure that the
     2528                // tabbar item content fits, since scrollbuttons are making beginning tabbar item smaller.
     2529                int scrollButtonSize = 0;
     2530                if (const QTabBar *tabBar = qobject_cast<const QTabBar *>(widget))
     2531                    scrollButtonSize = tabBar->usesScrollButtons() ? pixelMetric(PM_TabBarScrollButtonWidth) : 0;
     2532                if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
     2533                    const bool verticalTabs = tab->shape == QTabBar::RoundedEast
     2534                            || tab->shape == QTabBar::RoundedWest
     2535                            || tab->shape == QTabBar::TriangularEast
     2536                            || tab->shape == QTabBar::TriangularWest;
     2537                    if (tab->position == QStyleOptionTab::Beginning)
     2538                        sz += QSize(verticalTabs ? 0 : scrollButtonSize, !verticalTabs ? 0 : scrollButtonSize);
     2539                }
     2540            }
     2541            break;
     2542        case CT_MenuItem:
    23952543        case CT_ItemViewItem:
     2544            if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
     2545                if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) {
     2546                    sz = QSize();
     2547                    break;
     2548                }
     2549            }
    23962550            sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
    23972551            if (QS60StylePrivate::isTouchSupported())
    23982552                //Make itemview easier to use in touch devices
    23992553                //QCommonStyle does not adjust height with horizontal margin, it only adjusts width
    2400                 sz.setHeight(sz.height() + 2 * pixelMetric(QStyle::PM_FocusFrameVMargin));
     2554                sz.setHeight(sz.height() + 2 * pixelMetric(PM_FocusFrameVMargin));
    24012555            break;
    24022556#ifndef QT_NO_COMBOBOX
    2403         case CT_ComboBox:
    2404             if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
    2405                const int frameWidth = cmb->frame ? pixelMetric(PM_ComboBoxFrameWidth, opt, widget) * 2 : 0;
    2406                const int textMargins = 2*(pixelMetric(PM_FocusFrameHMargin) + 1);
    2407                const int smallestExtraWidth = 23;
    2408                // QItemDelegate::sizeHint expands the textMargins two times, thus the 2*textMargins...
    2409                const int extra =
    2410                    qMax(smallestExtraWidth, 2*textMargins + pixelMetric(PM_ScrollBarExtent, opt, widget));
    2411                sz = QSize(sz.width() + frameWidth + extra, sz.height() + frameWidth);
    2412                int maxScreenWidth = QApplication::desktop()->availableGeometry().size().width();
    2413                if (sz.width() > maxScreenWidth) {
    2414                    maxScreenWidth = maxScreenWidth - (extra + frameWidth);
    2415                    sz.setWidth(maxScreenWidth);
    2416                }
    2417            }
    2418            break;
     2557        case CT_ComboBox: {
     2558                // Fixing Ui design issues with too wide QComboBoxes and greedy SizeHints
     2559                // Make sure, that the combobox stays within the screen.
     2560                const QSize desktopContentSize = QApplication::desktop()->availableGeometry().size()
     2561                        - QSize(pixelMetric(PM_LayoutLeftMargin) + pixelMetric(PM_LayoutRightMargin), 0);
     2562                sz = QCommonStyle::sizeFromContents(ct, opt, csz, widget).
     2563                        boundedTo(desktopContentSize);
     2564            }
     2565            break;
    24192566#endif
    24202567        default:
     
    24292576                            QStyleHintReturn *hret) const
    24302577{
    2431     int retValue = -1;
     2578    int retValue = 0;
    24322579    switch (sh) {
     2580        case SH_RequestSoftwareInputPanel:
     2581            if (QS60StylePrivate::isSingleClickUi())
     2582                retValue = RSIP_OnMouseClick;
     2583            else
     2584                retValue = RSIP_OnMouseClickAndAlreadyFocused;
     2585            break;
     2586        case SH_ComboBox_Popup:
     2587            retValue = true;
     2588            break;
    24332589        case SH_Table_GridLineColor:
    24342590            retValue = int(QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors, 2, 0).rgba());
     
    24552611            retValue = QPalette::Base;
    24562612            break;
    2457         case SH_ItemView_ActivateItemOnSingleClick:
    2458             retValue = QS60StylePrivate::isSingleClickUi();
    2459             break;
     2613        case SH_ItemView_ActivateItemOnSingleClick: {
     2614            if (QS60StylePrivate::isSingleClickUi())
     2615                retValue = true;
     2616            else if (opt && opt->state & QStyle::State_Selected)
     2617                retValue = true;
     2618            break;
     2619        }
    24602620        case SH_ProgressDialog_TextLabelAlignment:
    24612621            retValue = (QApplication::layoutDirection() == Qt::LeftToRight) ?
     
    24722632            retValue = true;
    24732633            break;
     2634        case SH_Menu_MouseTracking:
     2635            retValue = true;
     2636            break;
    24742637        case SH_ItemView_ShowDecorationSelected:
    24752638            retValue = true;
     
    24842647            retValue = 0;
    24852648            break;
    2486         case SH_RequestSoftwareInputPanel:
    2487             retValue = RSIP_OnMouseClickAndAlreadyFocused;
    2488             break;
    24892649        case SH_FormLayoutWrapPolicy:
    24902650            retValue = QFormLayout::WrapLongRows;
     2651            break;
     2652        case SH_ScrollBar_ContextMenu:
     2653            retValue = false;
    24912654            break;
    24922655        default:
     
    25682731            const int frameThickness = spinbox->frame ? pixelMetric(PM_SpinBoxFrameWidth, spinbox, widget) : 0;
    25692732            const int buttonMargin = spinbox->frame ? 2 : 0;
    2570             const int buttonWidth = QS60StylePrivate::pixelMetric(QStyle::PM_ButtonIconSize) + 2 * buttonMargin;
     2733            const int buttonContentWidth = QS60StylePrivate::pixelMetric(PM_ButtonIconSize) + 2 * buttonMargin;
     2734            // Spinbox buttons should be no larger than one fourth of total width.
     2735            // Thus, side-by-side buttons would take half of the total width.
     2736            const int maxSize = qMax(spinbox->rect.width() / 4, buttonContentWidth);
    25712737            QSize buttonSize;
    2572             buttonSize.setHeight(qMax(8, spinbox->rect.height() - frameThickness));
     2738            buttonSize.setHeight(qMin(maxSize, qMax(8, spinbox->rect.height() - frameThickness)));
    25732739            //width should at least be equal to height
    2574             buttonSize.setWidth(qMax(buttonSize.height(), buttonWidth));
     2740            buttonSize.setWidth(qMax(buttonSize.height(), buttonContentWidth));
    25752741            buttonSize = buttonSize.expandedTo(QApplication::globalStrut());
    25762742
    2577             const int y = frameThickness + spinbox->rect.y();
    2578             const int x = spinbox->rect.x() + spinbox->rect.width() - frameThickness - 2 * buttonSize.width();
     2743            // Normally spinbuttons should be side-by-side, but if spinbox grows very big
     2744            // and spinbuttons reach their maximum size, they can be deployed one top of the other.
     2745            const bool sideBySide = (buttonSize.height() * 2 < spinbox->rect.height()) ? false : true;
     2746            const int y = frameThickness + spinbox->rect.y() + 
     2747                          (spinbox->rect.height() - (sideBySide ? 1 : 2) * buttonSize.height()) / 2;
     2748            const int x = spinbox->rect.x() +
     2749                          spinbox->rect.width() - frameThickness - (sideBySide ? 2 : 1) * buttonSize.width();
    25792750
    25802751            switch (scontrol) {
     
    25872758                    if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons)
    25882759                        return QRect();
    2589                     ret = QRect(x + buttonSize.width(), y, buttonSize.width(), buttonSize.height());
     2760                    ret = QRect(x + (sideBySide ? buttonSize.width() : 0),
     2761                                y + (sideBySide ? 0 : buttonSize.height()),
     2762                                buttonSize.width(), buttonSize.height());
    25902763                    break;
    25912764                case SC_SpinBoxEditField:
     
    26172790            const int width = cmb->rect.width();
    26182791            const int height = cmb->rect.height();
    2619             const int buttonIconSize = QS60StylePrivate::pixelMetric(QStyle::PM_ButtonIconSize);
     2792            const int buttonIconSize = QS60StylePrivate::pixelMetric(PM_ButtonIconSize);
    26202793            const int buttonMargin = cmb->frame ? 2 : 0;
    26212794            // lets use spinbox frame here as well, as no combobox specific value available.
     
    26432816                    }
    26442817                break;
     2818                case SC_ComboBoxListBoxPopup: {
     2819                    const QRect desktopContent = QApplication::desktop()->availableGeometry();
     2820
     2821                    // take the size of this and position bottom above available area
     2822                    QRect popupRect;
     2823                    const int width = desktopContent.width() - pixelMetric(PM_LayoutRightMargin) - pixelMetric(PM_LayoutLeftMargin);
     2824                    popupRect.setWidth(width);
     2825                    popupRect.setHeight(desktopContent.height()); //combobox resets height anyway based on content
     2826                    popupRect.setBottom(desktopContent.bottom());
     2827                    popupRect.translate(pixelMetric(PM_LayoutLeftMargin), 0);
     2828                    ret = popupRect;
     2829                    }
     2830                break;
    26452831            default:
    26462832                break;
     
    26572843                    //slightly indent text and boxes, so that dialog border does not mess with them.
    26582844                    const int horizontalSpacing =
    2659                         QS60StylePrivate::pixelMetric(QStyle::PM_LayoutHorizontalSpacing);
     2845                        QS60StylePrivate::pixelMetric(PM_LayoutHorizontalSpacing);
    26602846                    ret.adjust(2, horizontalSpacing - 3, 0, 0);
    26612847                    }
     
    27172903        case SE_LineEditContents: {
    27182904                // in S60 the input text box doesn't start from line Edit's TL, but
    2719                 // a bit indented.
    2720                 QRect lineEditRect = opt->rect;
    2721                 const int adjustment = opt->rect.height() >> 2;
    2722                 lineEditRect.adjust(adjustment, 0, 0, 0);
    2723                 ret = lineEditRect;
     2905                // a bit indented (8 pixels).
     2906                const int KLineEditDefaultIndention = 8;
     2907                ret = visualRect(
     2908                    opt->direction, opt->rect, opt->rect.adjusted(KLineEditDefaultIndention, 0, 0, 0));
    27242909            }
    27252910            break;
     
    27332918                if (const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) {
    27342919                    const int tabOverlapNoBorder =
    2735                         QS60StylePrivate::pixelMetric(QStyle::PM_TabBarTabOverlap);
     2920                        QS60StylePrivate::pixelMetric(PM_TabBarTabOverlap);
    27362921                    const int tabOverlap =
    2737                         tabOverlapNoBorder-QS60StylePrivate::pixelMetric(QStyle::PM_DefaultFrameWidth);
     2922                        tabOverlapNoBorder - QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth);
    27382923                    const QTabWidget *tab = qobject_cast<const QTabWidget *>(widget);
    27392924                    int gain = (tab) ? tabOverlap * tab->count() : 0;
     
    27842969                    (vopt->features & QStyleOptionViewItemV2::HasCheckIndicator)) {
    27852970                    const int verticalSpacing =
    2786                         QS60StylePrivate::pixelMetric(QStyle::PM_LayoutVerticalSpacing);
    2787                     //const int horizontalSpacing = QS60StylePrivate::pixelMetric(QStyle::PM_LayoutHorizontalSpacing);
     2971                        QS60StylePrivate::pixelMetric(PM_LayoutVerticalSpacing);
     2972                    //const int horizontalSpacing = QS60StylePrivate::pixelMetric(PM_LayoutHorizontalSpacing);
    27882973                    const int checkBoxRectWidth = subElementRect(SE_ItemViewItemCheckIndicator, opt, widget).width();
    27892974                    ret.adjust(-checkBoxRectWidth - verticalSpacing, 0, -checkBoxRectWidth - verticalSpacing, 0);
     
    27972982
    27982983                if (element == SE_ItemViewItemDecoration) {
    2799                     if (menuItem->direction == Qt::RightToLeft)
    2800                         ret.translate(ret.width()-indicatorWidth, 0);
    2801                     ret.setWidth(indicatorWidth);
     2984                    if (menuItem->icon.isNull()) {
     2985                        ret = QRect();
     2986                    } else {
     2987                        if (menuItem->direction == Qt::RightToLeft)
     2988                            ret.translate(ret.width() - indicatorWidth, 0);
     2989                        ret.setWidth(indicatorWidth);
     2990                    }
    28022991                } else {
    28032992                    ret = menuItem->rect;
     
    28203009            break;
    28213010        case SE_ItemViewItemCheckIndicator:
    2822             if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(opt)) {
     3011            if (const QStyleOptionViewItemV2 *vopt = qstyleoption_cast<const QStyleOptionViewItemV2 *>(opt)) {
    28233012                const QListWidget *listItem = qobject_cast<const QListWidget *>(widget);
    28243013
     
    28313020
    28323021                // Selection check mark rect.
    2833                 const int indicatorWidth = QS60StylePrivate::pixelMetric(QStyle::PM_IndicatorWidth);
    2834                 const int indicatorHeight = QS60StylePrivate::pixelMetric(QStyle::PM_IndicatorHeight);
    2835                 const int spacing = QS60StylePrivate::pixelMetric(QStyle::PM_CheckBoxLabelSpacing);
     3022                const int indicatorWidth = QS60StylePrivate::pixelMetric(PM_IndicatorWidth);
     3023                const int indicatorHeight = QS60StylePrivate::pixelMetric(PM_IndicatorHeight);
     3024                const int spacing = QS60StylePrivate::pixelMetric(PM_CheckBoxLabelSpacing);
    28363025
    28373026                const int itemHeight = opt->rect.height();
     
    28593048                // Subtract area needed for line
    28603049                if (opt->state & State_Horizontal)
    2861                     ret.setHeight(ret.height() - QS60StylePrivate::pixelMetric(PM_Custom_BoldLineWidth));
     3050                    ret.setHeight(ret.height() - QS60StylePrivate::pixelMetric(PM_BoldLineWidth));
    28623051                else
    2863                     ret.setWidth(ret.width() - QS60StylePrivate::pixelMetric(PM_Custom_ThinLineWidth));
     3052                    ret.setWidth(ret.width() - QS60StylePrivate::pixelMetric(PM_ThinLineWidth));
    28643053                }
    28653054            ret = visualRect(opt->direction, opt->rect, ret);
     
    29673156        widget->setPalette(QPalette());
    29683157
    2969 #ifndef QT_NO_PROGRESSBAR
     3158#if defined(Q_WS_S60) && !defined(QT_NO_PROGRESSBAR)
    29703159    if (QProgressBar *bar = qobject_cast<QProgressBar *>(widget)) {
    29713160        widget->removeEventFilter(this);
    29723161        d->m_bars.removeAll(bar);
    29733162    }
     3163#else
     3164    Q_UNUSED(d)
    29743165#endif
    29753166    QCommonStyle::unpolish(widget);
     
    29823173{
    29833174    Q_D(QS60Style);
     3175    QCommonStyle::polish(qApp);
    29843176    d->m_originalPalette = application->palette();
    29853177    d->setThemePalette(application);
     3178    if (QS60StylePrivate::isTouchSupported())
     3179        qApp->installEventFilter(this);
    29863180}
    29873181
     
    29923186{
    29933187    Q_UNUSED(application)
     3188
    29943189    Q_D(QS60Style);
     3190    QCommonStyle::unpolish(qApp);
    29953191    const QPalette newPalette = QApplication::style()->standardPalette();
    29963192    QApplication::setPalette(newPalette);
    29973193    QApplicationPrivate::setSystemPalette(d->m_originalPalette);
     3194    if (QS60StylePrivate::isTouchSupported())
     3195        qApp->removeEventFilter(this);
    29983196}
    29993197
     
    30033201bool QS60Style::event(QEvent *e)
    30043202{
     3203#ifdef QT_KEYPAD_NAVIGATION
    30053204    Q_D(QS60Style);
    3006 
    3007 #ifdef QT_KEYPAD_NAVIGATION
    30083205    const QEvent::Type eventType = e->type();
    30093206    if ((eventType == QEvent::FocusIn ||
     
    30243221    case QEvent::FocusIn:
    30253222        if (QWidget *focusWidget = QApplication::focusWidget()) {
     3223
     3224            // Menus and combobox popups do not draw focus frame around them
     3225            if (qobject_cast<QComboBoxListView *>(focusWidget) ||
     3226                qobject_cast<QMenu *>(focusWidget))
     3227                    break;
     3228
    30263229            if (!d->m_focusFrame)
    30273230                d->m_focusFrame = new QFocusFrame(focusWidget);
     
    30533256    const QStyleOption *option, const QWidget *widget) const
    30543257{
    3055     const int iconDimension = QS60StylePrivate::pixelMetric(QStyle::PM_ToolBarIconSize);
     3258    const int iconDimension = QS60StylePrivate::pixelMetric(PM_ToolBarIconSize);
    30563259    const QRect iconSize = (!option) ? QRect(0, 0, iconDimension, iconDimension) : option->rect;
    30573260    QS60StyleEnums::SkinParts part;
     
    30633266
    30643267    switch(standardIcon) {
    3065         case QStyle::SP_MessageBoxWarning:
     3268        case SP_MessageBoxWarning:
    30663269            part = QS60StyleEnums::SP_QgnNoteWarning;
    30673270            break;
    3068         case QStyle::SP_MessageBoxInformation:
     3271        case SP_MessageBoxInformation:
    30693272            part = QS60StyleEnums::SP_QgnNoteInfo;
    30703273            break;
    3071         case QStyle::SP_MessageBoxCritical:
     3274        case SP_MessageBoxCritical:
    30723275            part = QS60StyleEnums::SP_QgnNoteError;
    30733276            break;
    3074         case QStyle::SP_MessageBoxQuestion:
     3277        case SP_MessageBoxQuestion:
    30753278            part = QS60StyleEnums::SP_QgnNoteQuery;
    30763279            break;
    3077         case QStyle::SP_ArrowRight:
     3280        case SP_ArrowRight:
    30783281            part = QS60StyleEnums::SP_QgnIndiNaviArrowRight;
    30793282            break;
    3080         case QStyle::SP_ArrowLeft:
     3283        case SP_ArrowLeft:
    30813284            part = QS60StyleEnums::SP_QgnIndiNaviArrowLeft;
    30823285            break;
    3083         case QStyle::SP_ArrowUp:
     3286        case SP_ArrowUp:
    30843287            part = QS60StyleEnums::SP_QgnIndiNaviArrowLeft;
    30853288            adjustedFlags |= QS60StylePrivate::SF_PointEast;
    30863289            break;
    3087         case QStyle::SP_ArrowDown:
     3290        case SP_ArrowDown:
    30883291            part = QS60StyleEnums::SP_QgnIndiNaviArrowLeft;
    30893292            adjustedFlags |= QS60StylePrivate::SF_PointWest;
    30903293            break;
    3091         case QStyle::SP_ArrowBack:
     3294        case SP_ArrowBack:
    30923295            if (QApplication::layoutDirection() == Qt::RightToLeft)
    30933296                return QS60Style::standardIcon(SP_ArrowRight, option, widget);
    30943297            return QS60Style::standardIcon(SP_ArrowLeft, option, widget);
    3095         case QStyle::SP_ArrowForward:
     3298        case SP_ArrowForward:
    30963299            if (QApplication::layoutDirection() == Qt::RightToLeft)
    30973300                return QS60Style::standardIcon(SP_ArrowLeft, option, widget);
    30983301            return QS60Style::standardIcon(SP_ArrowRight, option, widget);
    3099         case QStyle::SP_ComputerIcon:
     3302        case SP_ComputerIcon:
    31003303            part = QS60StyleEnums::SP_QgnPropPhoneMemcLarge;
    31013304            break;
    3102         case QStyle::SP_DirClosedIcon:
     3305        case SP_DirClosedIcon:
    31033306            part = QS60StyleEnums::SP_QgnPropFolderSmall;
    31043307            break;
    3105         case QStyle::SP_DirOpenIcon:
     3308        case SP_DirOpenIcon:
    31063309            part = QS60StyleEnums::SP_QgnPropFolderCurrent;
    31073310            break;
    3108         case QStyle::SP_DirIcon:
     3311        case SP_DirIcon:
    31093312            part = QS60StyleEnums::SP_QgnPropFolderSmall;
    31103313            break;
    3111         case QStyle::SP_FileDialogNewFolder:
     3314        case SP_FileDialogNewFolder:
    31123315            part = QS60StyleEnums::SP_QgnPropFolderSmallNew;
    31133316            break;
    3114         case QStyle::SP_FileIcon:
     3317        case SP_FileIcon:
    31153318            part = QS60StyleEnums::SP_QgnPropFileSmall;
    31163319            break;
    3117         case QStyle::SP_TrashIcon:
     3320        case SP_TrashIcon:
    31183321            part = QS60StyleEnums::SP_QgnNoteErased;
    31193322            break;
    3120         case QStyle::SP_ToolBarHorizontalExtensionButton:
     3323        case SP_ToolBarHorizontalExtensionButton:
    31213324            part = QS60StyleEnums::SP_QgnIndiSubMenu;
    31223325            if (QApplication::layoutDirection() == Qt::RightToLeft)
    31233326                adjustedFlags |= QS60StylePrivate::SF_PointSouth;
    31243327            break;
    3125         case QStyle::SP_ToolBarVerticalExtensionButton:
     3328        case SP_ToolBarVerticalExtensionButton:
    31263329            adjustedFlags |= QS60StylePrivate::SF_PointEast;
    31273330            part = QS60StyleEnums::SP_QgnIndiSubMenu;
     
    31433346bool QS60Style::eventFilter(QObject *object, QEvent *event)
    31443347{
     3348    Q_D(QS60Style);
     3349    switch(event->type()) {
     3350        case QEvent::MouseButtonPress: {
     3351            QWidget *w = QApplication::widgetAt(QCursor::pos());
     3352            if (w) {
     3353                QWidget *focusW = w->focusProxy();
     3354                if (qobject_cast<QAbstractItemView *>(focusW) ||
     3355                    qobject_cast<QRadioButton *>(focusW) ||
     3356                    qobject_cast<QCheckBox *>(focusW))
     3357                    d->m_pressedWidget = focusW;
     3358                else if (qobject_cast<QAbstractItemView *>(w)||
     3359                        qobject_cast<QRadioButton *>(w) ||
     3360                        qobject_cast<QCheckBox *>(w))
     3361                    d->m_pressedWidget = w;
     3362
     3363                if ( d->m_pressedWidget)
     3364                    d->m_pressedWidget->update();
     3365            }
     3366            break;
     3367        }
     3368        case QEvent::MouseButtonRelease: {
     3369            const QWidget *w = QApplication::widgetAt(QCursor::pos());
     3370            if (w && d->m_pressedWidget) {
     3371                d->m_pressedWidget->update();
     3372                d->m_pressedWidget = 0;
     3373            }
     3374            break;
     3375        }
     3376        default:
     3377            break;
     3378    }
     3379
    31453380#ifdef Q_WS_S60
    31463381#ifndef QT_NO_PROGRESSBAR
    3147     Q_D(QS60Style);
    31483382    switch(event->type()) {
    31493383    case QEvent::StyleChange:
     
    31583392    case QEvent::Destroy:
    31593393    case QEvent::Hide:
    3160         d->stopAnimation(QS60StyleEnums::SP_QgnGrafBarWaitAnim);
    3161         d->m_bars.removeAll(reinterpret_cast<QProgressBar *>(object));
     3394        if (QProgressBar *bar = reinterpret_cast<QProgressBar *>(object)) {
     3395            d->stopAnimation(QS60StyleEnums::SP_QgnGrafBarWaitAnim);
     3396            d->m_bars.removeAll(bar);
     3397        }
    31623398        break;
    31633399    default:
     
    31663402#endif // QT_NO_PROGRESSBAR
    31673403#endif // Q_WS_S60
    3168     return QStyle::eventFilter(object, event);
    3169 }
    3170 
     3404    return QCommonStyle::eventFilter(object, event);
     3405}
     3406
     3407/*!
     3408    \internal
     3409    Handle the timer \a event.
     3410*/
    31713411void QS60Style::timerEvent(QTimerEvent *event)
    31723412{
Note: See TracChangeset for help on using the changeset viewer.