Changeset 651 for trunk/src/gui/styles


Ignore:
Timestamp:
Mar 8, 2010, 12:52:58 PM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.2 sources.

Location:
trunk
Files:
63 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk

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

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qcdestyle.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qcleanlooksstyle.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qcleanlooksstyle.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qcleanlooksstyle_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qcommonstyle.cpp

    r642 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qcommonstyle.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qcommonstyle_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qcommonstylepixmaps_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qgtkpainter.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qgtkpainter_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qgtkstyle.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    11071107        //           Murrine engine requires a widget not to get RGBA check - warnings
    11081108        GtkWidget *gtkCheckButton = d->gtkWidget(QLS("GtkCheckButton"));
    1109         gtkPainter.paintOption(gtkCheckButton , buttonRect, state, shadow, gtkRadioButton->style, QLS("radiobutton"));
    1110 
     1109        QString key(QLS("radiobutton"));
     1110        if (option->state & State_HasFocus) { // Themes such as Nodoka check this flag
     1111            key += QLatin1Char('f');
     1112            GTK_WIDGET_SET_FLAGS(gtkCheckButton, GTK_HAS_FOCUS);
     1113        }
     1114        gtkPainter.paintOption(gtkCheckButton , buttonRect, state, shadow, gtkRadioButton->style, key);
     1115        if (option->state & State_HasFocus)
     1116            GTK_WIDGET_UNSET_FLAGS(gtkCheckButton, GTK_HAS_FOCUS);
    11111117    }
    11121118    break;
     
    11291135
    11301136        GtkWidget *gtkCheckButton = d->gtkWidget(QLS("GtkCheckButton"));
     1137
     1138
     1139
     1140
     1141
    11311142
    11321143        // Some styles such as aero-clone assume they can paint in the spacing area
     
    11381149
    11391150        gtkPainter.paintCheckbox(gtkCheckButton, checkRect, state, shadow, gtkCheckButton->style,
    1140                                  QLS("checkbutton"));
     1151                                 key);
     1152        if (option->state & State_HasFocus)
     1153            GTK_WIDGET_UNSET_FLAGS(gtkCheckButton, GTK_HAS_FOCUS);
     1154
    11411155    }
    11421156    break;
     
    13781392                        gtkCachedPainter.paintFlatBox(gtkEntry, "entry_bg", contentRect,
    13791393                                                option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE,
    1380                                                 GTK_SHADOW_NONE, gtkCombo->style, entryPath + QString::number(focus));
     1394                                                GTK_SHADOW_NONE, gtk->style, entryPath + QString::number(focus));
    13811395                    }
    13821396
     
    17371751    case CC_SpinBox:
    17381752        if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
    1739             GtkWidget *gtkSpinButton = d->gtkWidget(QLS("GtkSpinButton"));
     1753
     1754            GtkWidget *gtkSpinButton = d->gtkWidget(
     1755                    spinBox->buttonSymbols == QAbstractSpinBox::NoButtons ?
     1756                    QLS("GtkEntry") :
     1757                    QLS("GtkSpinButton"));
    17401758            bool isEnabled = (spinBox->state & State_Enabled);
    17411759            bool hover = isEnabled && (spinBox->state & State_MouseOver);
     
    17451763            bool reverse = (spinBox->direction == Qt::RightToLeft);
    17461764
    1747             //### Move this to subControlRect
    1748             QRect upRect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxUp, widget);
    1749             upRect.setTop(option->rect.top());
    1750 
    1751             if (reverse)
    1752                 upRect.setLeft(option->rect.left());
    1753             else
    1754                 upRect.setRight(option->rect.right());
    1755 
     1765            QRect editArea = option->rect;
    17561766            QRect editRect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxEditField, widget);
    1757             QRect downRect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxDown, widget);
    1758             downRect.setBottom(option->rect.bottom());
    1759 
    1760             if (reverse)
    1761                 downRect.setLeft(option->rect.left());
    1762             else
    1763                 downRect.setRight(option->rect.right());
    1764 
    1765             QRect buttonRect = upRect | downRect;
    1766             QRect editArea = option->rect;
    1767 
    1768             if (reverse)
    1769                 editArea.setLeft(upRect.right());
    1770             else
    1771                 editArea.setRight(upRect.left());
    1772 
     1767            QRect upRect, downRect, buttonRect;
     1768            if (spinBox->buttonSymbols != QAbstractSpinBox::NoButtons) {
     1769                upRect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxUp, widget);
     1770                downRect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxDown, widget);
     1771
     1772                //### Move this to subControlRect
     1773                upRect.setTop(option->rect.top());
     1774
     1775                if (reverse)
     1776                    upRect.setLeft(option->rect.left());
     1777                else
     1778                    upRect.setRight(option->rect.right());
     1779
     1780                downRect.setBottom(option->rect.bottom());
     1781
     1782                if (reverse)
     1783                    downRect.setLeft(option->rect.left());
     1784                else
     1785                    downRect.setRight(option->rect.right());
     1786
     1787                buttonRect = upRect | downRect;
     1788
     1789                if (reverse)
     1790                    editArea.setLeft(upRect.right());
     1791                else
     1792                    editArea.setRight(upRect.left());
     1793            }
    17731794            if (spinBox->frame) {
    17741795                GtkShadowType shadow = GTK_SHADOW_OUT;
     
    18041825
    18051826                gtkPainter.paintShadow(gtkSpinButton, "entry", editArea, state, GTK_SHADOW_IN, gtkSpinButton->style, key);
    1806                 gtkPainter.paintBox(gtkSpinButton, "spinbutton", buttonRect, state, GTK_SHADOW_IN, style, key);
    1807 
    1808                 upRect.setSize(downRect.size());
    1809                 if (!(option->state & State_Enabled))
    1810                     gtkPainter.paintBox( gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_INSENSITIVE, GTK_SHADOW_IN, style, key);
    1811                 else if (upIsActive && sunken)
    1812                     gtkPainter.paintBox( gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_ACTIVE, GTK_SHADOW_IN, style, key);
    1813                 else if (upIsActive && hover)
    1814                     gtkPainter.paintBox( gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, style, key);
    1815                 else
    1816                     gtkPainter.paintBox( gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_NORMAL, GTK_SHADOW_OUT, style, key);
    1817 
    1818                 if (!(option->state & State_Enabled))
    1819                     gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_INSENSITIVE, GTK_SHADOW_IN, style, key);
    1820                 else if (downIsActive && sunken)
    1821                     gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_ACTIVE, GTK_SHADOW_IN, style, key);
    1822                 else if (downIsActive && hover)
    1823                     gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, style, key);
    1824                 else
    1825                     gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_NORMAL, GTK_SHADOW_OUT, style, key);
    1826 
    1827                 if (option->state & State_HasFocus)
    1828                     GTK_WIDGET_UNSET_FLAGS(gtkSpinButton, GTK_HAS_FOCUS);
     1827                if (spinBox->buttonSymbols != QAbstractSpinBox::NoButtons) {
     1828                    gtkPainter.paintBox(gtkSpinButton, "spinbutton", buttonRect, state, GTK_SHADOW_IN, style, key);
     1829
     1830                    upRect.setSize(downRect.size());
     1831                    if (!(option->state & State_Enabled))
     1832                        gtkPainter.paintBox( gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_INSENSITIVE, GTK_SHADOW_IN, style, key);
     1833                    else if (upIsActive && sunken)
     1834                        gtkPainter.paintBox( gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_ACTIVE, GTK_SHADOW_IN, style, key);
     1835                    else if (upIsActive && hover)
     1836                        gtkPainter.paintBox( gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, style, key);
     1837                    else
     1838                        gtkPainter.paintBox( gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_NORMAL, GTK_SHADOW_OUT, style, key);
     1839
     1840                    if (!(option->state & State_Enabled))
     1841                        gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_INSENSITIVE, GTK_SHADOW_IN, style, key);
     1842                    else if (downIsActive && sunken)
     1843                        gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_ACTIVE, GTK_SHADOW_IN, style, key);
     1844                    else if (downIsActive && hover)
     1845                        gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, style, key);
     1846                    else
     1847                        gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_NORMAL, GTK_SHADOW_OUT, style, key);
     1848
     1849                    if (option->state & State_HasFocus)
     1850                        GTK_WIDGET_UNSET_FLAGS(gtkSpinButton, GTK_HAS_FOCUS);
     1851                }
    18291852            }
    18301853
     
    18511874                }
    18521875
    1853             } else {
     1876            } else {
    18541877                int size = d->getSpinboxArrowSize();
    18551878                int w = size / 2 - 1;
     
    24962519            const int windowsItemVMargin      = 26; // menu item ver text margin
    24972520            const int windowsRightBorder      = 15; // right border on windows
    2498             GtkWidget *gtkMenu = d->gtkWidget(QLS("GtkMenu"));
    24992521            GtkWidget *gtkMenuItem = menuItem->checked ? d->gtkWidget(QLS("GtkMenu.GtkCheckMenuItem")) :
    25002522                                     d->gtkWidget(QLS("GtkMenu.GtkMenuItem"));
     
    25102532                gint     separator_height = 0;
    25112533                guint    horizontal_padding = 3;
     2534
    25122535                if (!d->gtk_check_version(2, 10, 0)) {
    25132536                    d->gtk_widget_style_get(gtkMenuSeparator,
     
    25172540                                           NULL);
    25182541                }
     2542
     2543
     2544
    25192545                if (wide_separators)
    2520                     gtkPainter.paintBox( gtkMenuSeparator, "hseparator",
    2521                                          option->rect.adjusted(0, 0, 0, -1), GTK_STATE_NORMAL, GTK_SHADOW_NONE, gtkMenu->style);
     2546                   gtkPainter.paintBox( gtkMenuSeparator, "hseparator",
     2547                                        ->style);
    25222548                else
    25232549                    gtkPainter.paintHline( gtkMenuSeparator, "hseparator",
    2524                                            menuItem->rect, GTK_STATE_NORMAL, gtkMenu->style,
    2525                                            option->rect.left() + horizontal_padding, option->rect.width() - 2*horizontal_padding, 2);
     2550                                           ->style,
     2551                                           );
    25262552                painter->restore();
    25272553                break;
     
    25312557
    25322558            if (selected) {
    2533                 QRect rect = option->rect.adjusted(0, 0, 0, -1);
     2559                QRect rect = option->rect;
    25342560#ifndef QT_NO_COMBOBOX
    25352561                if (qobject_cast<const QComboBox*>(widget))
     
    25572583            if (!ignoreCheckMark) {
    25582584                // Check
    2559                 QRect checkRect(option->rect.left() + 7, option->rect.center().y() - checkSize/2, checkSize, checkSize);
     2585                QRect checkRect(option->rect.left() + 7, option->rect.center().y() - checkSize/2, checkSize, checkSize);
    25602586                checkRect = visualRect(menuItem->direction, menuItem->rect, checkRect);
    25612587
     
    26812707            int xm = windowsItemFrame + checkcol + windowsItemHMargin;
    26822708            int xpos = menuitem->rect.x() + xm + 1;
    2683             QRect textRect(xpos, y + windowsItemVMargin - 1, w - xm - windowsRightBorder - tab + 1, h - 2 * windowsItemVMargin);
     2709            QRect textRect(xpos, y + windowsItemVMargin, w - xm - windowsRightBorder - tab + 1, h - 2 * windowsItemVMargin);
    26842710            QRect vTextRect = visualRect(opt->direction, menuitem->rect, textRect);
    26852711            QString s = menuitem->text;
     
    31513177        }
    31523178        break;
    3153 
    31543179    case CT_MenuItem:
    31553180        if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) {
     
    31583183            if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) {
    31593184                GtkWidget *gtkMenuSeparator = d->gtkWidget(QLS("GtkMenu.GtkSeparatorMenuItem"));
    3160                 gboolean wide_separators;
    3161                 gint     separator_height;
    3162                 d->gtk_widget_style_get(gtkMenuSeparator,
    3163                                        "wide-separators",    &wide_separators,
    3164                                        "separator-height",   &separator_height,
    3165                                        NULL);
    3166                 newSize = QSize(size.width(), wide_separators ? separator_height - 1 : 7 );
    3167 
     3185                GtkRequisition sizeReq = {0, 0};
     3186                d->gtk_widget_size_request(gtkMenuSeparator, &sizeReq);
     3187                newSize = QSize(size.width(), sizeReq.height);
    31683188                break;
    31693189            }
    31703190
    3171             GtkWidget *gtkMenuItem = d->gtkWidget(QLS("GtkMenu.GtkMenuItem"));
     3191            GtkWidget *gtkMenuItem = d->gtkWidget(QLS("GtkMenu.GtkMenuItem"));
    31723192            GtkStyle* style = gtkMenuItem->style;
    3173             newSize += QSize(textMargin + style->xthickness - 1, style->ythickness - 3);
     3193
     3194            // Note we get the perfect height for the default font since we
     3195            // set a fake text label on the gtkMenuItem
     3196            // But if custom fonts are used on the widget we need a minimum size
     3197            GtkRequisition sizeReq = {0, 0};
     3198            d->gtk_widget_size_request(gtkMenuItem, &sizeReq);
     3199            newSize.setHeight(qMax(newSize.height() - 4, sizeReq.height));
     3200            newSize += QSize(textMargin + style->xthickness - 1, 0);
    31743201
    31753202            // Cleanlooks assumes a check column of 20 pixels so we need to
    31763203            // expand it a bit
    31773204            gint checkSize;
    3178             d->gtk_widget_style_get(d->gtkWidget(QLS("GtkMenu.GtkCheckMenuItem")), "indicator-size", &checkSize, NULL);
    3179             newSize.setHeight(qMax(newSize.height(), checkSize + 2));
     3205            d->gtk_widget_style_get(gtkMenuItem, "indicator-size", &checkSize, NULL);
    31803206            newSize.setWidth(newSize.width() + qMax(0, checkSize - 20));
    31813207        }
    3182 
    3183         break;
    3184 
    3185     case CT_Menu:
    3186         // This is evil, but QMenu adds 1 pixel too much
    3187         newSize -= QSize(0, 1);
    31883208
    31893209        break;
  • trunk/src/gui/styles/qgtkstyle.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qgtkstyle_p.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    152152Ptr_gtk_separator_menu_item_new QGtkStylePrivate::gtk_separator_menu_item_new = 0;
    153153Ptr_gtk_widget_size_allocate QGtkStylePrivate::gtk_widget_size_allocate = 0;
     154
    154155Ptr_gtk_widget_set_direction QGtkStylePrivate::gtk_widget_set_direction = 0;
    155156Ptr_gtk_widget_path QGtkStylePrivate::gtk_widget_path = 0;
     
    160161Ptr_gtk_check_version QGtkStylePrivate::gtk_check_version = 0;
    161162Ptr_gtk_border_free QGtkStylePrivate::gtk_border_free = 0;
    162 
    163163Ptr_pango_font_description_get_size QGtkStylePrivate::pango_font_description_get_size = 0;
    164164Ptr_pango_font_description_get_weight QGtkStylePrivate::pango_font_description_get_weight = 0;
     
    411411    gtk_container_forall = (Ptr_gtk_container_forall)libgtk.resolve("gtk_container_forall");
    412412    gtk_widget_size_allocate =(Ptr_gtk_widget_size_allocate)libgtk.resolve("gtk_widget_size_allocate");
     413
    413414    gtk_widget_set_direction =(Ptr_gtk_widget_set_direction)libgtk.resolve("gtk_widget_set_direction");
    414415    gtk_widget_path =(Ptr_gtk_widget_path)libgtk.resolve("gtk_widget_path");
     
    416417    gtk_window_get_type =(Ptr_gtk_window_get_type)libgtk.resolve("gtk_window_get_type");
    417418    gtk_widget_get_type =(Ptr_gtk_widget_get_type)libgtk.resolve("gtk_widget_get_type");
     419
    418420    gtk_rc_get_style_by_paths =(Ptr_gtk_rc_get_style_by_paths)libgtk.resolve("gtk_rc_get_style_by_paths");
    419421    gtk_check_version =(Ptr_gtk_check_version)libgtk.resolve("gtk_check_version");
     
    448450
    449451    GtkWidget *gtkMenuItem = QGtkStylePrivate::gtk_menu_item_new();
     452
     453
    450454    gtk_menu_shell_append((GtkMenuShell*)gtkMenu, gtkMenuItem);
    451455    gtk_widget_realize(gtkMenuItem);
    452456
    453457    GtkWidget *gtkCheckMenuItem = QGtkStylePrivate::gtk_check_menu_item_new();
     458
    454459    gtk_menu_shell_append((GtkMenuShell*)gtkMenu, gtkCheckMenuItem);
    455460    gtk_widget_realize(gtkCheckMenuItem);
  • trunk/src/gui/styles/qgtkstyle_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    148148typedef void (*Ptr_gtk_container_forall) (GtkContainer *, GtkCallback, gpointer);
    149149typedef void (*Ptr_gtk_widget_size_allocate) (GtkWidget *, GtkAllocation*);
     150
    150151typedef void (*Ptr_gtk_widget_set_direction) (GtkWidget *, GtkTextDirection);
    151152typedef void (*Ptr_gtk_widget_path) (GtkWidget *, guint *, gchar **, gchar**);
     153
    152154typedef void (*Ptr_gtk_toolbar_insert) (GtkToolbar *toolbar, GtkToolItem *item, int pos);
    153155typedef void (*Ptr_gtk_menu_shell_append)(GtkMenuShell *, GtkWidget *);
     
    366368    static Ptr_gtk_separator_menu_item_new gtk_separator_menu_item_new;
    367369    static Ptr_gtk_widget_size_allocate gtk_widget_size_allocate;
     370
    368371    static Ptr_gtk_widget_set_direction gtk_widget_set_direction;
    369372    static Ptr_gtk_widget_path gtk_widget_path;
  • trunk/src/gui/styles/qmacstyle.qdoc

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qmacstyle_mac.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qmacstyle_mac.mm

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    668668    switch (ct) {
    669669    case QStyle::CT_PushButton: {
    670         const QPushButton *psh = static_cast<const QPushButton *>(widg);
    671         QString buttonText = qt_mac_removeMnemonics(psh->text());
    672         if (buttonText.contains(QLatin1Char('\n')))
    673             ret = QSize(-1, -1);
    674         else if (sz == QAquaSizeLarge)
    675             ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricPushButtonHeight));
    676         else if (sz == QAquaSizeSmall)
    677             ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricSmallPushButtonHeight));
    678         else if (sz == QAquaSizeMini)
    679             ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricMiniPushButtonHeight));
    680 
    681         if (!psh->icon().isNull()){
    682             // If the button got an icon, and the icon is larger than the
    683             // button, we can't decide on a default size
    684             ret.setWidth(-1);
    685             if (ret.height() < psh->iconSize().height())
    686                 ret.setHeight(-1);
    687         }
    688         else if (buttonText == QLatin1String("OK") || buttonText == QLatin1String("Cancel")){
    689             // Aqua Style guidelines restrict the size of OK and Cancel buttons to 68 pixels.
    690             // However, this doesn't work for German, therefore only do it for English,
    691             // I suppose it would be better to do some sort of lookups for languages
    692             // that like to have really long words.
    693             ret.setWidth(77 - 8);
    694         }
    695 
     670        const QPushButton *psh = qobject_cast<const QPushButton *>(widg);
     671        // If this comparison is false, then the widget was not a push button.
     672        // This is bad and there's very little we can do since we were requested to find a
     673        // sensible size for a widget that pretends to be a QPushButton but is not.
     674        if(psh) {
     675            QString buttonText = qt_mac_removeMnemonics(psh->text());
     676            if (buttonText.contains(QLatin1Char('\n')))
     677                ret = QSize(-1, -1);
     678            else if (sz == QAquaSizeLarge)
     679                ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricPushButtonHeight));
     680            else if (sz == QAquaSizeSmall)
     681                ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricSmallPushButtonHeight));
     682            else if (sz == QAquaSizeMini)
     683                ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricMiniPushButtonHeight));
     684
     685            if (!psh->icon().isNull()){
     686                // If the button got an icon, and the icon is larger than the
     687                // button, we can't decide on a default size
     688                ret.setWidth(-1);
     689                if (ret.height() < psh->iconSize().height())
     690                    ret.setHeight(-1);
     691            }
     692            else if (buttonText == QLatin1String("OK") || buttonText == QLatin1String("Cancel")){
     693                // Aqua Style guidelines restrict the size of OK and Cancel buttons to 68 pixels.
     694                // However, this doesn't work for German, therefore only do it for English,
     695                // I suppose it would be better to do some sort of lookups for languages
     696                // that like to have really long words.
     697                ret.setWidth(77 - 8);
     698            }
     699        } else {
     700            // The only sensible thing to do is to return whatever the style suggests...
     701            if (sz == QAquaSizeLarge)
     702                ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricPushButtonHeight));
     703            else if (sz == QAquaSizeSmall)
     704                ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricSmallPushButtonHeight));
     705            else if (sz == QAquaSizeMini)
     706                ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricMiniPushButtonHeight));
     707            else
     708                // Since there's no default size we return the large size...
     709                ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricPushButtonHeight));
     710         }
    696711#if 0 //Not sure we are applying the rules correctly for RadioButtons/CheckBoxes --Sam
    697712    } else if (ct == QStyle::CT_RadioButton) {
     
    750765            int width = 0, height = 0;
    751766            if (szHint == QSize(-1, -1)) { //just 'guess'..
    752                 const QToolButton *bt = static_cast<const QToolButton *>(widg);
    753                 if (!bt->icon().isNull()) {
    754                     QSize iconSize = bt->iconSize();
    755                     QSize pmSize = bt->icon().actualSize(QSize(32, 32), QIcon::Normal);
    756                     width = qMax(width, qMax(iconSize.width(), pmSize.width()));
    757                     height = qMax(height, qMax(iconSize.height(), pmSize.height()));
    758                 }
    759                 if (!bt->text().isNull() && bt->toolButtonStyle() != Qt::ToolButtonIconOnly) {
    760                     int text_width = bt->fontMetrics().width(bt->text()),
    761                        text_height = bt->fontMetrics().height();
    762                     if (bt->toolButtonStyle() == Qt::ToolButtonTextUnderIcon) {
    763                         width = qMax(width, text_width);
    764                         height += text_height;
    765                     } else {
    766                         width += text_width;
    767                         width = qMax(height, text_height);
     767                const QToolButton *bt = qobject_cast<const QToolButton *>(widg);
     768                // If this conversion fails then the widget was not what it claimed to be.
     769                if(bt) {
     770                    if (!bt->icon().isNull()) {
     771                        QSize iconSize = bt->iconSize();
     772                        QSize pmSize = bt->icon().actualSize(QSize(32, 32), QIcon::Normal);
     773                        width = qMax(width, qMax(iconSize.width(), pmSize.width()));
     774                        height = qMax(height, qMax(iconSize.height(), pmSize.height()));
    768775                    }
     776
     777
     778
     779
     780
     781
     782
     783
     784
     785
     786
     787
     788
     789
     790
    769791                }
    770792            } else {
     
    779801    case QStyle::CT_Slider: {
    780802        int w = -1;
    781         const QSlider *sld = static_cast<const QSlider *>(widg);
    782         if (sz == QAquaSizeLarge) {
    783             if (sld->orientation() == Qt::Horizontal) {
    784                 w = qt_mac_aqua_get_metric(kThemeMetricHSliderHeight);
    785                 if (sld->tickPosition() != QSlider::NoTicks)
    786                     w += qt_mac_aqua_get_metric(kThemeMetricHSliderTickHeight);
    787             } else {
    788                 w = qt_mac_aqua_get_metric(kThemeMetricVSliderWidth);
    789                 if (sld->tickPosition() != QSlider::NoTicks)
    790                     w += qt_mac_aqua_get_metric(kThemeMetricVSliderTickWidth);
    791             }
    792         } else if (sz == QAquaSizeSmall) {
    793             if (sld->orientation() == Qt::Horizontal) {
    794                 w = qt_mac_aqua_get_metric(kThemeMetricSmallHSliderHeight);
    795                 if (sld->tickPosition() != QSlider::NoTicks)
    796                     w += qt_mac_aqua_get_metric(kThemeMetricSmallHSliderTickHeight);
    797             } else {
    798                 w = qt_mac_aqua_get_metric(kThemeMetricSmallVSliderWidth);
    799                 if (sld->tickPosition() != QSlider::NoTicks)
    800                     w += qt_mac_aqua_get_metric(kThemeMetricSmallVSliderTickWidth);
    801             }
    802         } else if (sz == QAquaSizeMini) {
    803             if (sld->orientation() == Qt::Horizontal) {
    804                 w = qt_mac_aqua_get_metric(kThemeMetricMiniHSliderHeight);
    805                 if (sld->tickPosition() != QSlider::NoTicks)
    806                     w += qt_mac_aqua_get_metric(kThemeMetricMiniHSliderTickHeight);
    807             } else {
    808                 w = qt_mac_aqua_get_metric(kThemeMetricMiniVSliderWidth);
    809                 if (sld->tickPosition() != QSlider::NoTicks)
    810                     w += qt_mac_aqua_get_metric(kThemeMetricMiniVSliderTickWidth);
    811             }
     803        const QSlider *sld = qobject_cast<const QSlider *>(widg);
     804        // If this conversion fails then the widget was not what it claimed to be.
     805        if(sld) {
     806            if (sz == QAquaSizeLarge) {
     807                if (sld->orientation() == Qt::Horizontal) {
     808                    w = qt_mac_aqua_get_metric(kThemeMetricHSliderHeight);
     809                    if (sld->tickPosition() != QSlider::NoTicks)
     810                        w += qt_mac_aqua_get_metric(kThemeMetricHSliderTickHeight);
     811                } else {
     812                    w = qt_mac_aqua_get_metric(kThemeMetricVSliderWidth);
     813                    if (sld->tickPosition() != QSlider::NoTicks)
     814                        w += qt_mac_aqua_get_metric(kThemeMetricVSliderTickWidth);
     815                }
     816            } else if (sz == QAquaSizeSmall) {
     817                if (sld->orientation() == Qt::Horizontal) {
     818                    w = qt_mac_aqua_get_metric(kThemeMetricSmallHSliderHeight);
     819                    if (sld->tickPosition() != QSlider::NoTicks)
     820                        w += qt_mac_aqua_get_metric(kThemeMetricSmallHSliderTickHeight);
     821                } else {
     822                    w = qt_mac_aqua_get_metric(kThemeMetricSmallVSliderWidth);
     823                    if (sld->tickPosition() != QSlider::NoTicks)
     824                        w += qt_mac_aqua_get_metric(kThemeMetricSmallVSliderTickWidth);
     825                }
     826            } else if (sz == QAquaSizeMini) {
     827                if (sld->orientation() == Qt::Horizontal) {
     828                    w = qt_mac_aqua_get_metric(kThemeMetricMiniHSliderHeight);
     829                    if (sld->tickPosition() != QSlider::NoTicks)
     830                        w += qt_mac_aqua_get_metric(kThemeMetricMiniHSliderTickHeight);
     831                } else {
     832                    w = qt_mac_aqua_get_metric(kThemeMetricMiniVSliderWidth);
     833                    if (sld->tickPosition() != QSlider::NoTicks)
     834                        w += qt_mac_aqua_get_metric(kThemeMetricMiniVSliderTickWidth);
     835                }
     836            }
     837        } else {
     838            // This is tricky, we were requested to find a size for a slider which is not
     839            // a slider. We don't know if this is vertical or horizontal or if we need to
     840            // have tick marks or not.
     841            // For this case we will return an horizontal slider without tick marks.
     842            w = qt_mac_aqua_get_metric(kThemeMetricHSliderHeight);
     843            w += qt_mac_aqua_get_metric(kThemeMetricHSliderTickHeight);
    812844        }
    813845        if (sld->orientation() == Qt::Horizontal)
     
    23802412        break;
    23812413    case PM_ToolBarFrameWidth:
    2382         ret = 0;
     2414        ret = 1;
     2415        if (widget) {
     2416            if (QMainWindow * mainWindow = qobject_cast<QMainWindow *>(widget->parent()))
     2417                if (mainWindow->unifiedTitleAndToolBarOnMac())
     2418                    ret = 0;
     2419        }
    23832420        break;
    23842421    default:
     
    43104347                rect.setHeight(widget->height());
    43114348            }
    4312             if (opt->direction == Qt::RightToLeft)
    4313                 rect.adjust(15, 0, -20, 0);
    43144349        }
    43154350        break;
     
    56865721    case CT_ToolButton:
    56875722        if (widget && qobject_cast<const QToolBar *>(widget->parentWidget())) {
    5688             sz.rwidth() += 4;
    5689             if (sz.height() <= 32) {
    5690                 // Workaround strange HIToolBar bug when getting constraints.
    5691                 sz.rheight() += 1;
    5692             }
    5693             return sz;
     5723            if (QMainWindow * mainWindow = qobject_cast<QMainWindow *>(widget->parent())) {
     5724                if (mainWindow->unifiedTitleAndToolBarOnMac()) {
     5725                    sz.rwidth() += 4;
     5726                    if (sz.height() <= 32) {
     5727                        // Workaround strange HIToolBar bug when getting constraints.
     5728                        sz.rheight() += 1;
     5729                    }
     5730                    return sz;
     5731                }
     5732            }
    56945733        }
    56955734        sz.rwidth() += 10;
  • trunk/src/gui/styles/qmacstylepixmaps_mac_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qmotifstyle.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qmotifstyle.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qmotifstyle_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qplastiquestyle.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qplastiquestyle.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qproxystyle.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qproxystyle.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qproxystyle_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qs60style.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    6969#include "qfocusframe.h"
    7070#include "qformlayout.h"
     71
     72
     73
     74
    7175
    7276#include "private/qtoolbarextension_p.h"
     
    344348
    345349QFont QS60StylePrivate::s60Font(
    346     QS60StyleEnums::FontCategories fontCategory, int pointSize) const
     350    QS60StyleEnums::FontCategories fontCategory,
     351    int pointSize, bool resolveFontSize) const
    347352{
    348353    QFont result;
     
    357362    const QPair<QS60StyleEnums::FontCategories, int> key(fontCategory, actualPointSize);
    358363    if (!m_mappedFontsCache.contains(key)) {
    359         result = s60Font_specific(fontCategory, actualPointSize);
     364        result = s60Font_specific(fontCategory, actualPointSize);
    360365        m_mappedFontsCache.insert(key, result);
    361366    } else {
     
    564569{
    565570    QPixmap result;
     571
     572
    566573    const QString cacheKey =
    567         QString::fromLatin1("S60Style: SkinParts=%1 QSize=%2|%3 SkinPartFlags=%4")
    568             .arg((int)part).arg(size.width()).arg(size.height()).arg((int)flags);
     574        QString::fromLatin1("S60Style: SkinParts=%1 QSize=%2|%3 SkinPartFlags=%4")
     575            .arg((int)part).arg(size.width()).arg(size.height()).arg((int)flags);
    569576    if (!QPixmapCache::find(cacheKey, result)) {
    570577        result = QS60StylePrivate::part(part, size, painter, flags);
     
    621628    }
    622629    if (fontCategory != QS60StyleEnums::FC_Undefined) {
     630
     631
    623632        const QFont suggestedFont =
    624             s60Font(fontCategory, widget->font().pointSizeF());
     633            s60Font(fontCategory, widget->font().pointSizeF());
    625634        widget->setFont(suggestedFont);
    626635    }
     
    670679    // set background image as a texture brush
    671680    palette->setBrush(QPalette::Window, backgroundTexture());
    672     // set these as transparent so that styled full screen theme background is visible
    673     palette->setColor(QPalette::AlternateBase, Qt::transparent);
     681    // set as transparent so that styled full screen theme background is visible
    674682    palette->setBrush(QPalette::Base, Qt::transparent);
    675683    // set button and tooltipbase based on pixel colors
     
    683691    palette->setColor(QPalette::Mid, palette->color(QPalette::Button).darker(150));
    684692    palette->setColor(QPalette::Shadow, Qt::black);
     693
     694
     695
    685696
    686697    QApplication::setPalette(*palette); //calling QApplication::setPalette clears palette hash
     
    771782        s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0));
    772783    QApplication::setPalette(widgetPalette, "QComboBox");
     784
     785
     786
     787
     788
    773789    widgetPalette = *palette;
    774790
     
    811827            result.setWidth(result.height() >> 1);
    812828            break;
    813            
     829
    814830        case QS60StyleEnums::SP_QgnGrafNsliderEndLeft:
    815831        case QS60StyleEnums::SP_QgnGrafNsliderEndRight:
     
    817833            result.setWidth(result.height() >> 1);
    818834            break;
    819            
     835
    820836        case QS60StyleEnums::SP_QgnGrafNsliderMarker:
    821837        case QS60StyleEnums::SP_QgnGrafNsliderMarkerSelected:
     
    946962/*            if (optionSlider->state & QStyle::State_HasFocus)
    947963                drawPrimitive(PE_FrameFocusRect, optionSlider, painter, widget);*/
    948            
     964
    949965            //Groove graphics
    950966            if (QS60StylePrivate::hasSliderGrooveGraphic()) {
    951                 const QS60StylePrivate::SkinElements grooveElement = horizontal ? 
    952                     QS60StylePrivate::SE_SliderGrooveHorizontal : 
     967                const QS60StylePrivate::SkinElements grooveElement = horizontal ?
     968                    QS60StylePrivate::SE_SliderGrooveHorizontal :
    953969                    QS60StylePrivate::SE_SliderGrooveVertical;
    954970                QS60StylePrivate::drawSkinElement(grooveElement, painter, sliderGroove, flags);
     
    973989                handleElement =
    974990                        horizontal ? QS60StylePrivate::SE_SliderHandleSelectedHorizontal : QS60StylePrivate::SE_SliderHandleSelectedVertical;
    975             else   
     991            else
    976992                handleElement =
    977993                    horizontal ? QS60StylePrivate::SE_SliderHandleHorizontal : QS60StylePrivate::SE_SliderHandleVertical;
     
    9921008            const int maxHeight = cmbxFrame.height();
    9931009            const int maxWidth = cmbxFrame.width() - cmbxEditField.width();
    994             const int topLeftPoint = direction ? 
     1010            const int topLeftPoint = direction ?
    9951011                (cmbxEditField.right() + 1) : (cmbxEditField.left() + 1 - maxWidth);
    9961012            const QRect buttonRect(topLeftPoint, cmbxEditField.top(), maxWidth, maxHeight);
     
    10181034    case CC_ToolButton:
    10191035        if (const QStyleOptionToolButton *toolBtn = qstyleoption_cast<const QStyleOptionToolButton *>(option)) {
    1020             const State bflags = toolBtn->state;
     1036            State bflags = toolBtn->state & ~State_Sunken;
     1037
     1038            if (bflags & State_AutoRaise) {
     1039                if (!(bflags & State_MouseOver) || !(bflags & State_Enabled)) {
     1040                    bflags &= ~State_Raised;
     1041                }
     1042            }
     1043            State mflags = bflags;
     1044            if (toolBtn->state & State_Sunken) {
     1045                if (toolBtn->activeSubControls & SC_ToolButton)
     1046                    bflags |= State_Sunken;
     1047                mflags |= State_Sunken;
     1048            }
     1049
    10211050            const QRect button(subControlRect(control, toolBtn, SC_ToolButton, widget));
    10221051            QRect menuRect = QRect();
     
    10241053                menuRect = subControlRect(control, toolBtn, SC_ToolButtonMenu, widget);
    10251054
    1026             QStyleOptionToolButton toolButton = *toolBtn;
    1027 
    1028             if (sub&SC_ToolButton) {
     1055            if (toolBtn->subControls & SC_ToolButton) {
    10291056                QStyleOption tool(0);
    10301057                tool.palette = toolBtn->palette;
    10311058
    1032                 // Check if toolbutton is in toolbar.
    1033                 QToolBar *toolBar = 0;
    1034                 if (widget)
    1035                     toolBar = qobject_cast<QToolBar *>(widget->parentWidget());
    1036 
    1037                 if (bflags & (State_Sunken | State_On | State_Raised)) {
     1059                if (bflags & (State_Sunken | State_On | State_Raised | State_Enabled)) {
    10381060                    tool.rect = button.unite(menuRect);
    10391061                    tool.state = bflags;
    1040 
    1041                     // todo: I'd like to move extension button next to where last button is
    1042                     // however, the painter seems to want to clip the button rect even if I turn of the clipping.
    1043                     if (toolBar && (qobject_cast<const QToolBarExtension *>(widget))){
    1044                         /*QList<QAction *> actionList = toolBar->actions();
    1045                         const int actionCount = actionList.count();
    1046                         const int toolbarWidth = toolBar->width();
    1047                         const int extButtonWidth = pixelMetric(PM_ToolBarExtensionExtent, option, widget);
    1048                         const int toolBarButtonWidth = pixelMetric(PM_ToolBarIconSize, option, widget);
    1049                         const int frame = pixelMetric(PM_ToolBarFrameWidth, option, widget);
    1050                         const int margin = pixelMetric(PM_ToolBarItemMargin, option, widget);
    1051                         const int border = frame + margin;
    1052                         const int spacing = pixelMetric(PM_ToolBarItemSpacing, option, widget);
    1053                         const int toolBarButtonArea = toolbarWidth - extButtonWidth - spacing - 2*border;
    1054                         const int numberOfVisibleButtons = toolBarButtonArea / toolBarButtonWidth;
    1055                         // new extension button place is after border and all the other visible buttons (with spacings)
    1056                         const int newXForExtensionButton = numberOfVisibleButtons * toolBarButtonWidth + (numberOfVisibleButtons-1)*spacing + border;
    1057                         painter->save();
    1058                         painter->setClipping(false);
    1059                         tool.rect.translate(-newXForExtensionButton,0);
    1060                         painter->restore();*/
    1061                     }
    1062 
    1063                     if (toolBar){
    1064                         /*if (toolBar->orientation() == Qt::Vertical){
    1065                             // todo: I'd like to make all vertical buttons the same size, but again the painter
    1066                             // prefers to use clipping for button rects, even though clipping has been set off.
    1067                             painter->save();
    1068                             painter->setClipping(false);
    1069 
    1070                             const int origWidth = tool.rect.width();
    1071                             const int newWidth = toolBar->width()-2*pixelMetric(PM_ToolBarFrameWidth, option, widget);
    1072                             painter->translate(origWidth-newWidth,0);
    1073                             tool.rect.translate(origWidth-tool.rect.width(),0);
    1074                             tool.rect.setWidth(newWidth);
    1075 
    1076                             if (option->state & QStyle::State_Sunken)
    1077                                 QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ToolBarButtonPressed, painter, tool.rect, flags);
    1078                             else
    1079                                 QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ToolBarButton, painter, tool.rect, flags);
    1080 
    1081                         }*/
    1082                         if (option->state & QStyle::State_Sunken)
    1083                             QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ToolBarButtonPressed, painter, tool.rect, flags);
    1084                         else
    1085                             QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ToolBarButton, painter, tool.rect, flags);
    1086                         /*
    1087                         if (toolBar->orientation() == Qt::Vertical)
    1088                             painter->restore();
    1089                             */
    1090                     } else {
    1091                         drawPrimitive(PE_PanelButtonTool, &tool, painter, widget);
    1092                     }
    1093 
    1094                     if (toolButton.subControls & SC_ToolButtonMenu) {
    1095                         tool.rect = menuRect;
    1096                         tool.state = bflags;
    1097                         drawPrimitive(PE_IndicatorArrowDown, &tool, painter, widget);
    1098                     }
     1062                    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;
     1068                    QS60StylePrivate::drawSkinElement(element, painter, tool.rect, flags);
     1069                    drawPrimitive(PE_PanelButtonTool, &tool, painter, widget);
    10991070                }
    1100             }
    1101 
     1071                if (toolBtn->subControls & SC_ToolButtonMenu) {
     1072                    tool.rect = menuRect;
     1073                    tool.state = mflags;
     1074                    drawPrimitive(PE_IndicatorArrowDown, &tool, painter, widget);
     1075                }
     1076            }
     1077            QStyleOptionToolButton toolButton = *toolBtn;
    11021078            if (toolBtn->features & QStyleOptionToolButton::Arrow) {
    1103                 QStyle::PrimitiveElement pe;
     1079                PrimitiveElement pe;
    11041080                switch (toolBtn->arrowType) {
    11051081                    case Qt::LeftArrow:
    1106                         pe = QStyle::PE_IndicatorArrowLeft;
     1082                        pe = PE_IndicatorArrowLeft;
    11071083                        break;
    11081084                    case Qt::RightArrow:
    1109                         pe = QStyle::PE_IndicatorArrowRight;
     1085                        pe = PE_IndicatorArrowRight;
    11101086                        break;
    11111087                    case Qt::UpArrow:
    1112                         pe = QStyle::PE_IndicatorArrowUp;
     1088                        pe = PE_IndicatorArrowUp;
    11131089                        break;
    11141090                    case Qt::DownArrow:
    1115                         pe = QStyle::PE_IndicatorArrowDown;
     1091                        pe = PE_IndicatorArrowDown;
    11161092                        break;
    11171093                    default:
     
    12471223    const QS60StylePrivate::SkinElementFlags flags = (option->state & State_Enabled) ?  QS60StylePrivate::SF_StateEnabled : QS60StylePrivate::SF_StateDisabled;
    12481224    switch (element) {
     1225
     1226
     1227
     1228
     1229
     1230
     1231
     1232
     1233
     1234
     1235
     1236
     1237
     1238
     1239
     1240
     1241
     1242
     1243
     1244
     1245
     1246
     1247
     1248
     1249
    12491250    case CE_PushButton:
    12501251        if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option)) {
     
    13641365            }
    13651366
    1366             int rightValue = widget ? widget->contentsRect().right() : 0;
     1367            int rightValue = widget ? widget->contentsRect().right() : ;
    13671368
    13681369            if (isScrollBarVisible)
     
    16461647                const QS60StylePrivate::SkinElementFlag orientationFlag = optionProgressBar->orientation == Qt::Horizontal ?
    16471648                    QS60StylePrivate::SF_PointNorth : QS60StylePrivate::SF_PointWest;
    1648                 QS60StylePrivate::drawSkinPart(QS60StyleEnums::SP_QgnGrafBarWait, painter, progressRect, flags | orientationFlag);
     1649
     1650                QS60StylePrivate::drawSkinPart(QS60StyleEnums::SP_QgnGrafBarWaitAnim,
     1651                        painter, progressRect, flags | orientationFlag | QS60StylePrivate::SF_Animation );
    16491652            } else {
    16501653                const qreal progressFactor = (optionProgressBar->minimum == optionProgressBar->maximum) ? 1.0
    16511654                    : (qreal)optionProgressBar->progress / optionProgressBar->maximum;
     1655
    16521656                if (optionProgressBar->orientation == Qt::Horizontal) {
    16531657                    progressRect.setWidth(int(progressRect.width() * progressFactor));
    16541658                    if(optionProgressBar->direction == Qt::RightToLeft)
    1655                         progressRect.translate(optionProgressBar->rect.width()-progressRect.width(), 0);
    1656                     progressRect.adjust(1, 0, -1, 0);
     1659                        progressRect.translate(optionProgressBar->rect.width()progressRect.width(), 0);
     1660                    progressRect.adjust(, 0);
    16571661                } else {
    1658                     progressRect.adjust(0, 1, 0, -1);
     1662                    progressRect.adjust(0, );
    16591663                    progressRect.setTop(progressRect.bottom() - int(progressRect.height() * progressFactor));
    16601664                }
     
    19231927    case CE_MenuScroller:
    19241928        break;
    1925     case CE_FocusFrame:
    1926         {
     1929    case CE_FocusFrame: {
    19271930            // The pen width should nearly fill the layoutspacings around the widget
    19281931            const int penWidth =
     
    19881991
    19891992    switch (element) {
     1993
     1994
     1995
     1996
     1997
     1998
     1999
     2000
     2001
     2002
     2003
    19902004#ifndef QT_NO_LINEEDIT
    19912005    case PE_PanelLineEdit:
     
    20022016    break;
    20032017#endif // QT_NO_LINEEDIT
    2004     case PE_IndicatorCheckBox:
    2005         {
     2018    case PE_IndicatorCheckBox: {
    20062019            // Draw checkbox indicator as color skinned graphics.
    20072020            const QS60StyleEnums::SkinParts skinPart = (option->state & QStyle::State_On) ?
     
    20752088    case PE_PanelButtonTool:
    20762089    case PE_PanelButtonBevel:
    2077     case PE_FrameButtonBevel: {
     2090    case PE_FrameButtonBevel:
    20782091        if (QS60StylePrivate::canDrawThemeBackground(option->palette.base())) {
    20792092            const bool isPressed = option->state & QStyle::State_Sunken;
     
    20832096        } else {
    20842097            commonStyleDraws = true;
    2085             }
    20862098        }
    20872099        break;
     
    22052217#ifndef QT_NO_ITEMVIEWS
    22062218    case PE_PanelItemViewItem:
    2207     case PE_PanelItemViewRow: // ### Qt 5: remove
    22082219        break;
    22092220#endif //QT_NO_ITEMVIEWS
     
    22742285        }
    22752286        break;
    2276 
     2287    case PE_PanelItemViewRow: // ### Qt 5: remove
     2288#ifndef QT_NO_ITEMVIEWS
     2289        if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option)) {
     2290            if (vopt->palette.base().texture().cacheKey() != QS60StylePrivate::m_themePalette->base().texture().cacheKey()) {
     2291                //QPalette::Base has been changed, let commonstyle draw the item
     2292                commonStyleDraws = true;
     2293            } else {
     2294                QPalette::ColorGroup cg = vopt->state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled;
     2295                if (cg == QPalette::Normal && !(vopt->state & QStyle::State_Active))
     2296                    cg = QPalette::Inactive;
     2297                if (vopt->features & QStyleOptionViewItemV2::Alternate)
     2298                    painter->fillRect(vopt->rect, vopt->palette.brush(cg, QPalette::AlternateBase));
     2299                //apart from alternate base, no background for list item is drawn for S60Style
     2300            }
     2301        }
     2302#endif
     2303        break;
    22772304    case PE_PanelScrollAreaCorner:
    22782305        break;
     
    23592386                sz += QSize(2 * f->lineWidth, 4 * f->lineWidth);
    23602387            break;
    2361         case CT_TabBarTab:
    2362             {
     2388        case CT_TabBarTab: {
    23632389                const QSize naviPaneSize = QS60StylePrivate::naviPaneSize();
    23642390                sz = QCommonStyle::sizeFromContents(ct, opt, csz, widget);
     
    23742400                sz.setHeight(sz.height() + 2 * pixelMetric(QStyle::PM_FocusFrameVMargin));
    23752401            break;
     2402
     2403
     2404
     2405
     2406
     2407
     2408
     2409
     2410
     2411
     2412
     2413
     2414
     2415
     2416
     2417
     2418
     2419
    23762420        default:
    23772421            sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
     
    24122456            break;
    24132457        case SH_ItemView_ActivateItemOnSingleClick:
    2414             retValue = true;
     2458            retValue = ;
    24152459            break;
    24162460        case SH_ProgressDialog_TextLabelAlignment:
     
    25782622            const int frameThickness = cmb->frame ? pixelMetric(PM_SpinBoxFrameWidth, cmb, widget) : 0;
    25792623            const int buttonWidth = qMax(cmb->rect.height(), buttonIconSize);
    2580             const int xposMod = (cmb->rect.x()) + width - buttonMargin - buttonWidth;
    2581             const int ypos = cmb->rect.y();
    25822624
    25832625            QSize buttonSize;
     
    25862628            buttonSize = buttonSize.expandedTo(QApplication::globalStrut());
    25872629            switch (scontrol) {
    2588                 case SC_ComboBoxArrow:
     2630                case SC_ComboBoxArrow: {
     2631                    const int xposMod = cmb->rect.x() + width - buttonMargin - buttonWidth;
     2632                    const int ypos = cmb->rect.y();
    25892633                    ret.setRect(xposMod, ypos + buttonMargin, buttonWidth, height - 2 * buttonMargin);
     2634
    25902635                    break;
    25912636                case SC_ComboBoxEditField: {
    2592                     const int withFrameX = cmb->rect.x() + cmb->rect.width() - frameThickness - buttonSize.width();
     2637                    const int withFrameX = cmb->rect.x() + - frameThickness - buttonSize.width();
    25932638                    ret = QRect(
    25942639                        frameThickness,
    25952640                        frameThickness,
    25962641                        withFrameX - frameThickness,
    2597                         cmb->rect.height() - 2 * frameThickness);
     2642                        - 2 * frameThickness);
    25982643                    }
    25992644                break;
     
    26012646                break;
    26022647            }
     2648
    26032649        }
    26042650        break;
     
    26662712    QRect ret;
    26672713    switch (element) {
     2714
     2715
     2716
    26682717        case SE_LineEditContents: {
    26692718                // in S60 the input text box doesn't start from line Edit's TL, but
     
    28162865            ret = visualRect(opt->direction, opt->rect, ret);
    28172866            break;
     2867
     2868
     2869
     2870
     2871
     2872
     2873
     2874
     2875
     2876
     2877
     2878
     2879
     2880
     2881
     2882
     2883
     2884
     2885
    28182886        default:
    28192887            ret = QCommonStyle::subElementRect(element, opt, widget);
     
    28322900    if (!widget)
    28332901        return;
     2902
     2903
     2904
     2905
     2906
     2907
    28342908
    28352909    if (false
     
    28652939void QS60Style::unpolish(QWidget *widget)
    28662940{
     2941
     2942
    28672943    if (false
    28682944    #ifndef QT_NO_SCROLLBAR
     
    28912967        widget->setPalette(QPalette());
    28922968
     2969
     2970
     2971
     2972
     2973
     2974
    28932975    QCommonStyle::unpolish(widget);
    28942976}
     
    29213003bool QS60Style::event(QEvent *e)
    29223004{
     3005
     3006
    29233007#ifdef QT_KEYPAD_NAVIGATION
    2924     if (QS60StylePrivate::isTouchSupported())
    2925         return false;
    2926     Q_D(QS60Style);
     3008    const QEvent::Type eventType = e->type();
     3009    if ((eventType == QEvent::FocusIn ||
     3010         eventType == QEvent::FocusOut ||
     3011         eventType == QEvent::EnterEditFocus ||
     3012         eventType == QEvent::LeaveEditFocus) &&
     3013        QS60StylePrivate::isTouchSupported())
     3014            return false;
     3015#endif
     3016
    29273017    switch (e->type()) {
     3018
     3019
     3020
     3021
     3022
     3023
    29283024    case QEvent::FocusIn:
    29293025        if (QWidget *focusWidget = QApplication::focusWidget()) {
     
    29443040            d->m_focusFrame->update();
    29453041        break;
     3042
    29463043    default:
    29473044        break;
    29483045    }
    2949 #else
    2950     Q_UNUSED(e)
    2951 #endif
    29523046    return false;
    29533047}
     
    30433137}
    30443138
     3139
     3140
     3141
     3142
     3143
     3144
     3145
     3146
     3147
     3148
     3149
     3150
     3151
     3152
     3153
     3154
     3155
     3156
     3157
     3158
     3159
     3160
     3161
     3162
     3163
     3164
     3165
     3166
     3167
     3168
     3169
     3170
     3171
     3172
     3173
     3174
     3175
     3176
     3177
     3178
     3179
     3180
     3181
     3182
     3183
     3184
     3185
     3186
     3187
     3188
     3189
     3190
     3191
     3192
     3193
     3194
     3195
     3196
     3197
     3198
     3199
     3200
    30453201extern QPoint qt_s60_fill_background_offset(const QWidget *targetWidget);
    30463202
     
    30543210    if (target->devType() == QInternal::Widget) {
    30553211        const QWidget *widget = static_cast<const QWidget *>(target);
    3056         const QVector<QRect> &rects = rgn.rects();
    3057         for (int i = 0; i < rects.size(); ++i) {
    3058             const QRect rect(rects.at(i));
    3059             painter->drawPixmap(rect.topLeft(), backgroundTexture,
    3060                                 rect.translated(qt_s60_fill_background_offset(widget)));
     3212        if (!widget->testAttribute(Qt::WA_TranslucentBackground)) {
     3213            const QVector<QRect> &rects = rgn.rects();
     3214            for (int i = 0; i < rects.size(); ++i) {
     3215                const QRect rect(rects.at(i));
     3216                painter->drawPixmap(rect.topLeft(), backgroundTexture,
     3217                                    rect.translated(qt_s60_fill_background_offset(widget)));
     3218            }
    30613219        }
    30623220    }
  • trunk/src/gui/styles/qs60style.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    9595            StandardPixmap standardIcon, const QStyleOption * option = 0, const QWidget * widget = 0 ) const;
    9696
     97
     98
     99
    97100private:
    98101    Q_DISABLE_COPY(QS60Style)
  • trunk/src/gui/styles/qs60style_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    9494
    9595public:
     96
     97
     98
     99
     100
     101
     102
     103
     104
     105
     106
     107
     108
     109
     110
     111
     112
     113
     114
     115
     116
     117
     118
    96119    // S60 look-and-feel font categories
    97120    enum FontCategories {
     
    105128
    106129    enum SkinParts {
    107         SP_QgnGrafBarWait,
     130        SP_QgnGrafBarWait,
    108131        SP_QgnGrafBarFrameCenter,
    109132        SP_QgnGrafBarFrameSideL,
     
    288311};
    289312
     313
     314
     315
     316
     317
     318
     319
     320
     321
     322
     323
     324
     325
     326
     327
     328
     329
     330
     331
     332
     333
     334
     335
     336
     337
     338
     339
     340
     341
     342
     343
     344
     345
     346
     347
     348
     349
     350
     351
     352
     353
     354
     355
     356
     357
     358
     359
     360
     361
     362
     363
     364
     365
     366
     367
     368
     369
     370
     371
     372
     373
    290374class QFocusFrame;
     375
     376
    291377
    292378// Private class
     
    372458        SF_StateDisabled =    0x0020,
    373459        SF_ColorSkinned =     0x0040, // pixmap is colored with foreground pen color
     460
    374461    };
    375462
     
    402489
    403490    QFont s60Font(QS60StyleEnums::FontCategories fontCategory,
    404         int pointSize = -1) const;
     491        int pointSize = -1) const;
    405492    // clears all style caches (fonts, colors, pixmaps)
    406493    void clearCaches(CacheClearReason reason = CC_UndefinedChange);
     
    413500    static bool isToolBarBackground();
    414501    static bool hasSliderGrooveGraphic();
     502
    415503
    416504    // calculates average color based on button skin graphics (minus borders).
     
    455543    //so that theme graphic background can be drawn.
    456544    static bool canDrawThemeBackground(const QBrush &backgroundBrush);
     545
     546
     547
     548
     549
     550
     551
     552
     553
     554
    457555
    458556private:
     
    485583        QPainter *painter, SkinElementFlags flags = KDefaultSkinElementFlags);
    486584
    487     static QFont s60Font_specific(QS60StyleEnums::FontCategories fontCategory, int pointSize);
     585    static QFont s60Font_specific(QS60StyleEnums::FontCategories fontCategory,
     586                                  int pointSize, bool resolveFontSize);
    488587
    489588    static QSize screenSize();
     
    497596
    498597    QPointer<QFocusFrame> m_focusFrame;
     598
     599
     600
     601
     602
     603
    499604};
    500605
  • trunk/src/gui/styles/qs60style_s60.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    6464#include <aknnavi.h>
    6565#include <gulicon.h>
     66
    6667
    6768#if !defined(QT_NO_STYLE_S60) || defined(QT_PLUGIN)
     
    7374    EDrawGulIcon,
    7475    EDrawBackground,
     76
    7577    ENoDraw
    7678};
     
    98100} partMapEntry;
    99101
     102
     103
     104
     105
     106
     107
     108
     109
     110
     111
     112
     113
     114
     115
     116
     117
     118
     119
     120
     121
     122
     123
     124
     125
     126
     127
     128
     129
     130
     131
     132
     133
     134
     135
     136
     137
     138
     139
     140
     141
     142
    100143class QS60StyleModeSpecifics
    101144{
     
    114157    static TAknsItemID partSpecificThemeId(int part);
    115158
     159
     160
    116161private:
    117162    static QPixmap createSkinnedGraphicsLX(QS60StyleEnums::SkinParts part,
     
    129174
    130175const partMapEntry QS60StyleModeSpecifics::m_partMap[] = {
    131     /* SP_QgnGrafBarWait */                {KAknsIIDQgnGrafBarWaitAnim,            EDrawIcon,   ES60_All,    -1,-1},
     176    /* SP_QgnGrafBarWaiton,   ES60_All,    -1,-1},
    132177    /* SP_QgnGrafBarFrameCenter */         {KAknsIIDQgnGrafBarFrameCenter,         EDrawIcon,   ES60_All,    -1,-1},
    133178    /* SP_QgnGrafBarFrameSideL */          {KAknsIIDQgnGrafBarFrameSideL,          EDrawIcon,   ES60_All,    -1,-1},
     
    372417{
    373418    switch(stylePart) {
    374         case QS60StyleEnums::SP_QgnGrafBarWait:
     419        case QS60StyleEnums::SP_QgnGrafBarWait:
    375420            fallbackIndex = EMbmAvkonQgn_graf_bar_wait_1;
    376421            break;
     
    605650}
    606651
     652
     653
     654
     655
     656
    607657QPoint qt_s60_fill_background_offset(const QWidget *targetWidget)
    608658{
     
    710760            break;
    711761        }
     762
     763
     764
     765
     766
     767
     768
     769
     770
     771
     772
     773
     774
     775
     776
     777
     778
     779
     780
     781
     782
     783
     784
     785
     786
     787
     788
     789
     790
     791
     792
     793
     794
     795
     796
     797
     798
     799
     800
     801
     802
     803
     804
     805
     806
     807
     808
     809
     810
     811
     812
     813
     814
     815
     816
     817
     818
     819
     820
     821
     822
     823
     824
    712825    }
    713826    if (!result)
     
    732845    QPixmap result;
    733846
    734 //        QS60WindowSurface::unlockBitmapHeap();
    735847    static const TDisplayMode displayMode = S60->supportsPremultipliedAlpha ? Q_SYMBIAN_ECOLOR16MAP : EColor16MA;
    736848    static const TInt drawParam = S60->supportsPremultipliedAlpha ? KAknsDrawParamDefault : KAknsDrawParamNoClearUnderImage|KAknsDrawParamRGBOnly;
     
    9101022
    9111023QFont QS60StylePrivate::s60Font_specific(
    912     QS60StyleEnums::FontCategories fontCategory, int pointSize)
    913 {
     1024    QS60StyleEnums::FontCategories fontCategory,
     1025    int pointSize, bool resolveFontSize)
     1026{
     1027    Q_UNUSED(resolveFontSize);
     1028
    9141029    TAknFontCategory aknFontCategory = EAknFontCategoryUndefined;
    9151030    switch (fontCategory) {
     
    9831098}
    9841099
     1100
     1101
    9851102QS60StylePrivate::QS60StylePrivate()
    9861103{
     1104
     1105
     1106
    9871107    // No need to set active layout, if dynamic metrics API is available
    9881108    setActiveLayout();
     
    11851305        topLevelWidget->ensurePolished();
    11861306    }
     1307
     1308
     1309
     1310
     1311
    11871312}
    11881313
     
    12041329}
    12051330
     1331
     1332
     1333
     1334
     1335
     1336
     1337
     1338
     1339
     1340
     1341
     1342
     1343
     1344
     1345
     1346
     1347
     1348
     1349
     1350
     1351
     1352
     1353
     1354
     1355
     1356
     1357
     1358
     1359
     1360
     1361
     1362
     1363
     1364
     1365
     1366
     1367
     1368
     1369
     1370
     1371
     1372
     1373
     1374
     1375
     1376
     1377
     1378
     1379
     1380
     1381
     1382
     1383
     1384
     1385
     1386
     1387
     1388
     1389
     1390
     1391
     1392
     1393
     1394
     1395
     1396
     1397
     1398
     1399
     1400
     1401
     1402
     1403
     1404
     1405
     1406
     1407
     1408
     1409
     1410
     1411
     1412
     1413
     1414
     1415
     1416
     1417
     1418
     1419
     1420
     1421
     1422
     1423
     1424
     1425
     1426
     1427
     1428
     1429
     1430
     1431
     1432
     1433
     1434
     1435
     1436
     1437
     1438
     1439
     1440
     1441
     1442
     1443
     1444
     1445
    12061446#endif // Q_WS_S60
    12071447
  • trunk/src/gui/styles/qs60style_simulated.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    343343}
    344344
    345 QFont QS60StylePrivate::s60Font_specific(QS60StyleEnums::FontCategories fontCategory, int pointSize)
     345bool QS60StylePrivate::isSingleClickUi()
     346{
     347    return false;
     348}
     349
     350QFont QS60StylePrivate::s60Font_specific(
     351        QS60StyleEnums::FontCategories fontCategory,
     352        int pointSize, bool resolveFontSize)
    346353{
    347354    QFont result;
    348     result.setPointSize(pointSize);
     355    if (resolveFontSize)
     356        result.setPointSize(pointSize);
    349357    switch (fontCategory) {
    350358        case QS60StyleEnums::FC_Primary:
     
    360368    }
    361369    return result;
     370
     371
     372
     373
     374
    362375}
    363376
  • trunk/src/gui/styles/qstyle.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qstyle.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qstyle_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qstylefactory.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qstylefactory.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qstylehelper.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qstylehelper_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qstyleoption.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qstyleoption.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qstyleplugin.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qstyleplugin.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qstylesheetstyle.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    11261126void QRenderRule::drawBorderImage(QPainter *p, const QRect& rect)
    11271127{
     1128
    11281129    static const Qt::TileRule tileMode2TileRule[] = {
    11291130        Qt::StretchTile, Qt::RoundTile, Qt::StretchTile, Qt::RepeatTile, Qt::StretchTile };
     
    11431144                      QTileRules(tileMode2TileRule[borderImageData->horizStretch], tileMode2TileRule[borderImageData->vertStretch]));
    11441145    p->setRenderHint(QPainter::SmoothPixmapTransform, wasSmoothPixmapTransform);
     1146
    11451147}
    11461148
     
    56125614        if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(opt)) {
    56135615            QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem);
    5614             QStyleOptionViewItemV4 optCopy(*vopt);
    5615             optCopy.rect = subRule.contentsRect(vopt->rect);
    5616             QRect rect = ParentStyle::subElementRect(se, &optCopy, w);
    56175616            PseudoElement pe = PseudoElement_None;
    56185617            if (se == SE_ItemViewItemText || se == SE_ItemViewItemFocusRect)
     
    56245623            else
    56255624                break;
    5626             QRenderRule subRule2 = renderRule(w, opt, pe);
    5627             return positionRect(w, subRule2, pe, rect, opt->direction);
     5625            if (subRule.hasGeometry() || subRule.hasBox() || !subRule.hasNativeBorder() || hasStyleRule(w, pe)) {
     5626                QRenderRule subRule2 = renderRule(w, opt, pe);
     5627                QStyleOptionViewItemV4 optCopy(*vopt);
     5628                optCopy.rect = subRule.contentsRect(vopt->rect);
     5629                QRect rect = ParentStyle::subElementRect(se, &optCopy, w);
     5630                return positionRect(w, subRule2, pe, rect, opt->direction);
     5631            }
    56285632         }
    56295633        break;
  • trunk/src/gui/styles/qstylesheetstyle_default.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qstylesheetstyle_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qwindowscestyle.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qwindowscestyle.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qwindowscestyle_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qwindowsmobilestyle.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qwindowsmobilestyle.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qwindowsmobilestyle_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qwindowsstyle.cpp

    r642 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qwindowsstyle.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qwindowsstyle_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qwindowsvistastyle.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qwindowsvistastyle.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qwindowsvistastyle_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qwindowsxpstyle.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qwindowsxpstyle.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/qwindowsxpstyle_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/styles/styles.pri

    r561 r651  
    2424        styles/qstylesheetstyle_default.cpp
    2525
    26 !wince* {
    27         RESOURCES += styles/qstyle.qrc
     26wince* {
     27    RESOURCES += styles/qstyle_wince.qrc
     28} else:symbian {
     29    RESOURCES += styles/qstyle_s60.qrc
    2830} else {
    29         RESOURCES += styles/qstyle_wince.qrc
     31    e.qrc
    3032}
    3133
     
    169171        symbian {
    170172                SOURCES += styles/qs60style_s60.cpp
    171                 LIBS += -laknicon -laknskins -laknskinsrv -lfontutils -legul
     173                LIBS += -laknicon -laknskins -laknskinsrv -lfontutils -legul
    172174        } else {
    173175                SOURCES += styles/qs60style_simulated.cpp
Note: See TracChangeset for help on using the changeset viewer.