summaryrefslogtreecommitdiffstats
path: root/src/gui/styles
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/styles')
-rw-r--r--src/gui/styles/qcdestyle.cpp2
-rw-r--r--src/gui/styles/qcdestyle.h2
-rw-r--r--src/gui/styles/qcleanlooksstyle.cpp4
-rw-r--r--src/gui/styles/qcleanlooksstyle.h2
-rw-r--r--src/gui/styles/qcleanlooksstyle_p.h2
-rw-r--r--src/gui/styles/qcommonstyle.cpp2
-rw-r--r--src/gui/styles/qcommonstyle.h2
-rw-r--r--src/gui/styles/qcommonstyle_p.h2
-rw-r--r--src/gui/styles/qcommonstylepixmaps_p.h2
-rw-r--r--src/gui/styles/qgtkpainter.cpp2
-rw-r--r--src/gui/styles/qgtkpainter_p.h2
-rw-r--r--src/gui/styles/qgtkstyle.cpp150
-rw-r--r--src/gui/styles/qgtkstyle.h2
-rw-r--r--src/gui/styles/qgtkstyle_p.cpp9
-rw-r--r--src/gui/styles/qgtkstyle_p.h5
-rw-r--r--src/gui/styles/qmacstyle.qdoc2
-rw-r--r--src/gui/styles/qmacstyle_mac.h2
-rw-r--r--src/gui/styles/qmacstyle_mac.mm4
-rw-r--r--src/gui/styles/qmacstylepixmaps_mac_p.h2
-rw-r--r--src/gui/styles/qmotifstyle.cpp2
-rw-r--r--src/gui/styles/qmotifstyle.h2
-rw-r--r--src/gui/styles/qmotifstyle_p.h2
-rw-r--r--src/gui/styles/qplastiquestyle.cpp2
-rw-r--r--src/gui/styles/qplastiquestyle.h2
-rw-r--r--src/gui/styles/qproxystyle.cpp2
-rw-r--r--src/gui/styles/qproxystyle.h2
-rw-r--r--src/gui/styles/qproxystyle_p.h2
-rw-r--r--src/gui/styles/qs60style.cpp11
-rw-r--r--src/gui/styles/qs60style.h2
-rw-r--r--src/gui/styles/qs60style_p.h7
-rw-r--r--src/gui/styles/qs60style_s60.cpp7
-rw-r--r--src/gui/styles/qs60style_simulated.cpp9
-rw-r--r--src/gui/styles/qstyle.cpp2
-rw-r--r--src/gui/styles/qstyle.h2
-rw-r--r--src/gui/styles/qstyle_p.h2
-rw-r--r--src/gui/styles/qstylefactory.cpp2
-rw-r--r--src/gui/styles/qstylefactory.h2
-rw-r--r--src/gui/styles/qstylehelper.cpp2
-rw-r--r--src/gui/styles/qstylehelper_p.h2
-rw-r--r--src/gui/styles/qstyleoption.cpp12
-rw-r--r--src/gui/styles/qstyleoption.h2
-rw-r--r--src/gui/styles/qstyleplugin.cpp2
-rw-r--r--src/gui/styles/qstyleplugin.h2
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp14
-rw-r--r--src/gui/styles/qstylesheetstyle_default.cpp2
-rw-r--r--src/gui/styles/qstylesheetstyle_p.h2
-rw-r--r--src/gui/styles/qwindowscestyle.cpp2
-rw-r--r--src/gui/styles/qwindowscestyle.h2
-rw-r--r--src/gui/styles/qwindowscestyle_p.h2
-rw-r--r--src/gui/styles/qwindowsmobilestyle.cpp2
-rw-r--r--src/gui/styles/qwindowsmobilestyle.h2
-rw-r--r--src/gui/styles/qwindowsmobilestyle_p.h2
-rw-r--r--src/gui/styles/qwindowsstyle.cpp2
-rw-r--r--src/gui/styles/qwindowsstyle.h2
-rw-r--r--src/gui/styles/qwindowsstyle_p.h2
-rw-r--r--src/gui/styles/qwindowsvistastyle.cpp2
-rw-r--r--src/gui/styles/qwindowsvistastyle.h2
-rw-r--r--src/gui/styles/qwindowsvistastyle_p.h2
-rw-r--r--src/gui/styles/qwindowsxpstyle.cpp2
-rw-r--r--src/gui/styles/qwindowsxpstyle.h2
-rw-r--r--src/gui/styles/qwindowsxpstyle_p.h2
61 files changed, 180 insertions, 152 deletions
diff --git a/src/gui/styles/qcdestyle.cpp b/src/gui/styles/qcdestyle.cpp
index 5d70d6a..6a1201f 100644
--- a/src/gui/styles/qcdestyle.cpp
+++ b/src/gui/styles/qcdestyle.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qcdestyle.h b/src/gui/styles/qcdestyle.h
index b3b620e..2762506 100644
--- a/src/gui/styles/qcdestyle.h
+++ b/src/gui/styles/qcdestyle.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qcleanlooksstyle.cpp b/src/gui/styles/qcleanlooksstyle.cpp
index b08847d..0f39b23 100644
--- a/src/gui/styles/qcleanlooksstyle.cpp
+++ b/src/gui/styles/qcleanlooksstyle.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -2069,7 +2069,7 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o
// This is mainly to handle cases where someone sets the font on the window
// and then the combo inherits it and passes it onward. At that point the resolve mask
// is very, very weak. This makes it stonger.
- font.setPointSizeF(menuItem->font.pointSizeF());
+ font.setPointSizeF(QFontInfo(menuItem->font).pointSizeF());
if (menuitem->menuItemType == QStyleOptionMenuItem::DefaultItem)
font.setBold(true);
diff --git a/src/gui/styles/qcleanlooksstyle.h b/src/gui/styles/qcleanlooksstyle.h
index 33defb9..0a0eafc 100644
--- a/src/gui/styles/qcleanlooksstyle.h
+++ b/src/gui/styles/qcleanlooksstyle.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qcleanlooksstyle_p.h b/src/gui/styles/qcleanlooksstyle_p.h
index 96f1e85..c6c64f7 100644
--- a/src/gui/styles/qcleanlooksstyle_p.h
+++ b/src/gui/styles/qcleanlooksstyle_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp
index 64e1919..2a1d336 100644
--- a/src/gui/styles/qcommonstyle.cpp
+++ b/src/gui/styles/qcommonstyle.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qcommonstyle.h b/src/gui/styles/qcommonstyle.h
index af848ec..7f78778 100644
--- a/src/gui/styles/qcommonstyle.h
+++ b/src/gui/styles/qcommonstyle.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qcommonstyle_p.h b/src/gui/styles/qcommonstyle_p.h
index 6122f81..7684602 100644
--- a/src/gui/styles/qcommonstyle_p.h
+++ b/src/gui/styles/qcommonstyle_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qcommonstylepixmaps_p.h b/src/gui/styles/qcommonstylepixmaps_p.h
index b6c7f89..4ca9736 100644
--- a/src/gui/styles/qcommonstylepixmaps_p.h
+++ b/src/gui/styles/qcommonstylepixmaps_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qgtkpainter.cpp b/src/gui/styles/qgtkpainter.cpp
index aaa029a..6cc7455 100644
--- a/src/gui/styles/qgtkpainter.cpp
+++ b/src/gui/styles/qgtkpainter.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qgtkpainter_p.h b/src/gui/styles/qgtkpainter_p.h
index cbc96c0..bf18e8e 100644
--- a/src/gui/styles/qgtkpainter_p.h
+++ b/src/gui/styles/qgtkpainter_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp
index e10bb41..abb9e1e 100644
--- a/src/gui/styles/qgtkstyle.cpp
+++ b/src/gui/styles/qgtkstyle.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -1736,7 +1736,11 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
case CC_SpinBox:
if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
- GtkWidget *gtkSpinButton = d->gtkWidget(QLS("GtkSpinButton"));
+
+ GtkWidget *gtkSpinButton = d->gtkWidget(
+ spinBox->buttonSymbols == QAbstractSpinBox::NoButtons ?
+ QLS("GtkEntry") :
+ QLS("GtkSpinButton"));
bool isEnabled = (spinBox->state & State_Enabled);
bool hover = isEnabled && (spinBox->state & State_MouseOver);
bool sunken = (spinBox->state & State_Sunken);
@@ -1744,32 +1748,35 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
bool downIsActive = (spinBox->activeSubControls == SC_SpinBoxDown);
bool reverse = (spinBox->direction == Qt::RightToLeft);
- //### Move this to subControlRect
- QRect upRect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxUp, widget);
- upRect.setTop(option->rect.top());
+ QRect editArea = option->rect;
+ QRect editRect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxEditField, widget);
+ QRect upRect, downRect, buttonRect;
+ if (spinBox->buttonSymbols != QAbstractSpinBox::NoButtons) {
+ upRect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxUp, widget);
+ downRect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxDown, widget);
- if (reverse)
- upRect.setLeft(option->rect.left());
- else
- upRect.setRight(option->rect.right());
+ //### Move this to subControlRect
+ upRect.setTop(option->rect.top());
- QRect editRect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxEditField, widget);
- QRect downRect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxDown, widget);
- downRect.setBottom(option->rect.bottom());
+ if (reverse)
+ upRect.setLeft(option->rect.left());
+ else
+ upRect.setRight(option->rect.right());
- if (reverse)
- downRect.setLeft(option->rect.left());
- else
- downRect.setRight(option->rect.right());
+ downRect.setBottom(option->rect.bottom());
- QRect buttonRect = upRect | downRect;
- QRect editArea = option->rect;
+ if (reverse)
+ downRect.setLeft(option->rect.left());
+ else
+ downRect.setRight(option->rect.right());
- if (reverse)
- editArea.setLeft(upRect.right());
- else
- editArea.setRight(upRect.left());
+ buttonRect = upRect | downRect;
+ if (reverse)
+ editArea.setLeft(upRect.right());
+ else
+ editArea.setRight(upRect.left());
+ }
if (spinBox->frame) {
GtkShadowType shadow = GTK_SHADOW_OUT;
GtkStateType state = gtkPainter.gtkState(option);
@@ -1803,29 +1810,31 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, GTK_SHADOW_NONE, style, key);
gtkPainter.paintShadow(gtkSpinButton, "entry", editArea, state, GTK_SHADOW_IN, gtkSpinButton->style, key);
- gtkPainter.paintBox(gtkSpinButton, "spinbutton", buttonRect, state, GTK_SHADOW_IN, style, key);
-
- upRect.setSize(downRect.size());
- if (!(option->state & State_Enabled))
- gtkPainter.paintBox( gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_INSENSITIVE, GTK_SHADOW_IN, style, key);
- else if (upIsActive && sunken)
- gtkPainter.paintBox( gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_ACTIVE, GTK_SHADOW_IN, style, key);
- else if (upIsActive && hover)
- gtkPainter.paintBox( gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, style, key);
- else
- gtkPainter.paintBox( gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_NORMAL, GTK_SHADOW_OUT, style, key);
-
- if (!(option->state & State_Enabled))
- gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_INSENSITIVE, GTK_SHADOW_IN, style, key);
- else if (downIsActive && sunken)
- gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_ACTIVE, GTK_SHADOW_IN, style, key);
- else if (downIsActive && hover)
- gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, style, key);
- else
- gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_NORMAL, GTK_SHADOW_OUT, style, key);
+ if (spinBox->buttonSymbols != QAbstractSpinBox::NoButtons) {
+ gtkPainter.paintBox(gtkSpinButton, "spinbutton", buttonRect, state, GTK_SHADOW_IN, style, key);
+
+ upRect.setSize(downRect.size());
+ if (!(option->state & State_Enabled))
+ gtkPainter.paintBox( gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_INSENSITIVE, GTK_SHADOW_IN, style, key);
+ else if (upIsActive && sunken)
+ gtkPainter.paintBox( gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_ACTIVE, GTK_SHADOW_IN, style, key);
+ else if (upIsActive && hover)
+ gtkPainter.paintBox( gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, style, key);
+ else
+ gtkPainter.paintBox( gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_NORMAL, GTK_SHADOW_OUT, style, key);
+
+ if (!(option->state & State_Enabled))
+ gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_INSENSITIVE, GTK_SHADOW_IN, style, key);
+ else if (downIsActive && sunken)
+ gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_ACTIVE, GTK_SHADOW_IN, style, key);
+ else if (downIsActive && hover)
+ gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, style, key);
+ else
+ gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_NORMAL, GTK_SHADOW_OUT, style, key);
- if (option->state & State_HasFocus)
- GTK_WIDGET_UNSET_FLAGS(gtkSpinButton, GTK_HAS_FOCUS);
+ if (option->state & State_HasFocus)
+ GTK_WIDGET_UNSET_FLAGS(gtkSpinButton, GTK_HAS_FOCUS);
+ }
}
if (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus) {
@@ -1850,7 +1859,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
painter->drawLine(centerX - 2, centerY, centerX + 2, centerY);
}
- } else {
+ } else if (spinBox->buttonSymbols == QAbstractSpinBox::UpDownArrows) {
int size = d->getSpinboxArrowSize();
int w = size / 2 - 1;
w -= w % 2 - 1; // force odd
@@ -2495,7 +2504,6 @@ void QGtkStyle::drawControl(ControlElement element,
const int windowsItemHMargin = 3; // menu item hor text margin
const int windowsItemVMargin = 26; // menu item ver text margin
const int windowsRightBorder = 15; // right border on windows
- GtkWidget *gtkMenu = d->gtkWidget(QLS("GtkMenu"));
GtkWidget *gtkMenuItem = menuItem->checked ? d->gtkWidget(QLS("GtkMenu.GtkCheckMenuItem")) :
d->gtkWidget(QLS("GtkMenu.GtkMenuItem"));
@@ -2509,6 +2517,7 @@ void QGtkStyle::drawControl(ControlElement element,
gboolean wide_separators = 0;
gint separator_height = 0;
guint horizontal_padding = 3;
+ QRect separatorRect = option->rect;
if (!d->gtk_check_version(2, 10, 0)) {
d->gtk_widget_style_get(gtkMenuSeparator,
"wide-separators", &wide_separators,
@@ -2516,13 +2525,16 @@ void QGtkStyle::drawControl(ControlElement element,
"horizontal-padding", &horizontal_padding,
NULL);
}
+ separatorRect.setHeight(option->rect.height() - 2 * gtkMenuSeparator->style->ythickness);
+ separatorRect.setWidth(option->rect.width() - 2 * (horizontal_padding + gtkMenuSeparator->style->xthickness));
+ separatorRect.moveCenter(option->rect.center());
if (wide_separators)
- gtkPainter.paintBox( gtkMenuSeparator, "hseparator",
- option->rect.adjusted(0, 0, 0, -1), GTK_STATE_NORMAL, GTK_SHADOW_NONE, gtkMenu->style);
+ gtkPainter.paintBox( gtkMenuSeparator, "hseparator",
+ separatorRect, GTK_STATE_NORMAL, GTK_SHADOW_NONE, gtkMenuSeparator->style);
else
gtkPainter.paintHline( gtkMenuSeparator, "hseparator",
- menuItem->rect, GTK_STATE_NORMAL, gtkMenu->style,
- option->rect.left() + horizontal_padding, option->rect.width() - 2*horizontal_padding, 2);
+ separatorRect, GTK_STATE_NORMAL, gtkMenuSeparator->style,
+ 0, option->rect.right() - 1, 1);
painter->restore();
break;
}
@@ -2530,7 +2542,7 @@ void QGtkStyle::drawControl(ControlElement element,
bool selected = menuItem->state & State_Selected && menuItem->state & State_Enabled;
if (selected) {
- QRect rect = option->rect.adjusted(0, 0, 0, -1);
+ QRect rect = option->rect;
#ifndef QT_NO_COMBOBOX
if (qobject_cast<const QComboBox*>(widget))
rect = option->rect;
@@ -2556,7 +2568,7 @@ void QGtkStyle::drawControl(ControlElement element,
#endif
if (!ignoreCheckMark) {
// Check
- QRect checkRect(option->rect.left() + 7, option->rect.center().y() - checkSize/2, checkSize, checkSize);
+ QRect checkRect(option->rect.left() + 7, option->rect.center().y() - checkSize/2 + 1, checkSize, checkSize);
checkRect = visualRect(menuItem->direction, menuItem->rect, checkRect);
if (checkable && menuItem->icon.isNull()) {
@@ -2680,7 +2692,7 @@ void QGtkStyle::drawControl(ControlElement element,
int tab = menuitem->tabWidth;
int xm = windowsItemFrame + checkcol + windowsItemHMargin;
int xpos = menuitem->rect.x() + xm + 1;
- QRect textRect(xpos, y + windowsItemVMargin - 1, w - xm - windowsRightBorder - tab + 1, h - 2 * windowsItemVMargin);
+ QRect textRect(xpos, y + windowsItemVMargin, w - xm - windowsRightBorder - tab + 1, h - 2 * windowsItemVMargin);
QRect vTextRect = visualRect(opt->direction, menuitem->rect, textRect);
QString s = menuitem->text;
@@ -3150,44 +3162,38 @@ QSize QGtkStyle::sizeFromContents(ContentsType type, const QStyleOption *option,
newSize += QSize(6, 0);
}
break;
-
case CT_MenuItem:
if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) {
int textMargin = 8;
if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) {
GtkWidget *gtkMenuSeparator = d->gtkWidget(QLS("GtkMenu.GtkSeparatorMenuItem"));
- gboolean wide_separators;
- gint separator_height;
- d->gtk_widget_style_get(gtkMenuSeparator,
- "wide-separators", &wide_separators,
- "separator-height", &separator_height,
- NULL);
- newSize = QSize(size.width(), wide_separators ? separator_height - 1 : 7 );
-
+ GtkRequisition sizeReq = {0, 0};
+ d->gtk_widget_size_request(gtkMenuSeparator, &sizeReq);
+ newSize = QSize(size.width(), sizeReq.height);
break;
}
- GtkWidget *gtkMenuItem = d->gtkWidget(QLS("GtkMenu.GtkMenuItem"));
+ GtkWidget *gtkMenuItem = d->gtkWidget(QLS("GtkMenu.GtkCheckMenuItem"));
GtkStyle* style = gtkMenuItem->style;
- newSize += QSize(textMargin + style->xthickness - 1, style->ythickness - 3);
+
+ // Note we get the perfect height for the default font since we
+ // set a fake text label on the gtkMenuItem
+ // But if custom fonts are used on the widget we need a minimum size
+ GtkRequisition sizeReq = {0, 0};
+ d->gtk_widget_size_request(gtkMenuItem, &sizeReq);
+ newSize.setHeight(qMax(newSize.height() - 4, sizeReq.height));
+ newSize += QSize(textMargin + style->xthickness - 1, 0);
// Cleanlooks assumes a check column of 20 pixels so we need to
// expand it a bit
gint checkSize;
- d->gtk_widget_style_get(d->gtkWidget(QLS("GtkMenu.GtkCheckMenuItem")), "indicator-size", &checkSize, NULL);
- newSize.setHeight(qMax(newSize.height(), checkSize + 2));
+ d->gtk_widget_style_get(gtkMenuItem, "indicator-size", &checkSize, NULL);
newSize.setWidth(newSize.width() + qMax(0, checkSize - 20));
}
break;
- case CT_Menu:
- // This is evil, but QMenu adds 1 pixel too much
- newSize -= QSize(0, 1);
-
- break;
-
case CT_SpinBox:
// QSpinBox does some nasty things that depends on CT_LineEdit
newSize = size + QSize(0, -d->gtkWidget(QLS("GtkSpinButton"))->style->ythickness * 2);
diff --git a/src/gui/styles/qgtkstyle.h b/src/gui/styles/qgtkstyle.h
index 5c3bad1..ee5de0c 100644
--- a/src/gui/styles/qgtkstyle.h
+++ b/src/gui/styles/qgtkstyle.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qgtkstyle_p.cpp b/src/gui/styles/qgtkstyle_p.cpp
index a644a5b..a033407 100644
--- a/src/gui/styles/qgtkstyle_p.cpp
+++ b/src/gui/styles/qgtkstyle_p.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -151,6 +151,7 @@ Ptr_gtk_menu_item_set_submenu QGtkStylePrivate::gtk_menu_item_set_submenu = 0;
Ptr_gtk_settings_get_default QGtkStylePrivate::gtk_settings_get_default = 0;
Ptr_gtk_separator_menu_item_new QGtkStylePrivate::gtk_separator_menu_item_new = 0;
Ptr_gtk_widget_size_allocate QGtkStylePrivate::gtk_widget_size_allocate = 0;
+Ptr_gtk_widget_size_request QGtkStylePrivate::gtk_widget_size_request = 0;
Ptr_gtk_widget_set_direction QGtkStylePrivate::gtk_widget_set_direction = 0;
Ptr_gtk_widget_path QGtkStylePrivate::gtk_widget_path = 0;
Ptr_gtk_container_get_type QGtkStylePrivate::gtk_container_get_type = 0;
@@ -159,7 +160,6 @@ Ptr_gtk_widget_get_type QGtkStylePrivate::gtk_widget_get_type = 0;
Ptr_gtk_rc_get_style_by_paths QGtkStylePrivate::gtk_rc_get_style_by_paths = 0;
Ptr_gtk_check_version QGtkStylePrivate::gtk_check_version = 0;
Ptr_gtk_border_free QGtkStylePrivate::gtk_border_free = 0;
-
Ptr_pango_font_description_get_size QGtkStylePrivate::pango_font_description_get_size = 0;
Ptr_pango_font_description_get_weight QGtkStylePrivate::pango_font_description_get_weight = 0;
Ptr_pango_font_description_get_family QGtkStylePrivate::pango_font_description_get_family = 0;
@@ -410,11 +410,13 @@ void QGtkStylePrivate::resolveGtk() const
gtk_combo_box_entry_new = (Ptr_gtk_combo_box_entry_new)libgtk.resolve("gtk_combo_box_entry_new");
gtk_container_forall = (Ptr_gtk_container_forall)libgtk.resolve("gtk_container_forall");
gtk_widget_size_allocate =(Ptr_gtk_widget_size_allocate)libgtk.resolve("gtk_widget_size_allocate");
+ gtk_widget_size_request =(Ptr_gtk_widget_size_request)libgtk.resolve("gtk_widget_size_request");
gtk_widget_set_direction =(Ptr_gtk_widget_set_direction)libgtk.resolve("gtk_widget_set_direction");
gtk_widget_path =(Ptr_gtk_widget_path)libgtk.resolve("gtk_widget_path");
gtk_container_get_type =(Ptr_gtk_container_get_type)libgtk.resolve("gtk_container_get_type");
gtk_window_get_type =(Ptr_gtk_window_get_type)libgtk.resolve("gtk_window_get_type");
gtk_widget_get_type =(Ptr_gtk_widget_get_type)libgtk.resolve("gtk_widget_get_type");
+
gtk_rc_get_style_by_paths =(Ptr_gtk_rc_get_style_by_paths)libgtk.resolve("gtk_rc_get_style_by_paths");
gtk_check_version =(Ptr_gtk_check_version)libgtk.resolve("gtk_check_version");
gtk_border_free =(Ptr_gtk_border_free)libgtk.resolve("gtk_border_free");
@@ -447,10 +449,13 @@ void QGtkStylePrivate::initGtkMenu() const
gtk_widget_realize(gtkMenu);
GtkWidget *gtkMenuItem = QGtkStylePrivate::gtk_menu_item_new();
+ g_object_set(gtkMenuItem, "label", "X", NULL);
+
gtk_menu_shell_append((GtkMenuShell*)gtkMenu, gtkMenuItem);
gtk_widget_realize(gtkMenuItem);
GtkWidget *gtkCheckMenuItem = QGtkStylePrivate::gtk_check_menu_item_new();
+ g_object_set(gtkCheckMenuItem, "label", "X", NULL);
gtk_menu_shell_append((GtkMenuShell*)gtkMenu, gtkCheckMenuItem);
gtk_widget_realize(gtkCheckMenuItem);
diff --git a/src/gui/styles/qgtkstyle_p.h b/src/gui/styles/qgtkstyle_p.h
index c27308f..db5b9b9 100644
--- a/src/gui/styles/qgtkstyle_p.h
+++ b/src/gui/styles/qgtkstyle_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -147,8 +147,10 @@ typedef void (*Ptr_gtk_paint_vline) (GtkStyle *, GdkWindow *, GtkStateType, co
typedef void (*Ptr_gtk_menu_item_set_submenu) (GtkMenuItem *, GtkWidget *);
typedef void (*Ptr_gtk_container_forall) (GtkContainer *, GtkCallback, gpointer);
typedef void (*Ptr_gtk_widget_size_allocate) (GtkWidget *, GtkAllocation*);
+typedef void (*Ptr_gtk_widget_size_request) (GtkWidget *widget, GtkRequisition *requisition);
typedef void (*Ptr_gtk_widget_set_direction) (GtkWidget *, GtkTextDirection);
typedef void (*Ptr_gtk_widget_path) (GtkWidget *, guint *, gchar **, gchar**);
+
typedef void (*Ptr_gtk_toolbar_insert) (GtkToolbar *toolbar, GtkToolItem *item, int pos);
typedef void (*Ptr_gtk_menu_shell_append)(GtkMenuShell *, GtkWidget *);
typedef GtkType (*Ptr_gtk_container_get_type) (void);
@@ -365,6 +367,7 @@ public:
static Ptr_gtk_settings_get_default gtk_settings_get_default;
static Ptr_gtk_separator_menu_item_new gtk_separator_menu_item_new;
static Ptr_gtk_widget_size_allocate gtk_widget_size_allocate;
+ static Ptr_gtk_widget_size_request gtk_widget_size_request;
static Ptr_gtk_widget_set_direction gtk_widget_set_direction;
static Ptr_gtk_widget_path gtk_widget_path;
static Ptr_gtk_container_get_type gtk_container_get_type;
diff --git a/src/gui/styles/qmacstyle.qdoc b/src/gui/styles/qmacstyle.qdoc
index 3d2ead9..f4afed3 100644
--- a/src/gui/styles/qmacstyle.qdoc
+++ b/src/gui/styles/qmacstyle.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qmacstyle_mac.h b/src/gui/styles/qmacstyle_mac.h
index 73875c2..bcebb1d 100644
--- a/src/gui/styles/qmacstyle_mac.h
+++ b/src/gui/styles/qmacstyle_mac.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index 53740fc..833708e 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -4008,7 +4008,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
// This is mainly to handle cases where someone sets the font on the window
// and then the combo inherits it and passes it onward. At that point the resolve mask
// is very, very weak. This makes it stonger.
- myFont.setPointSizeF(mi->font.pointSizeF());
+ myFont.setPointSizeF(QFontInfo(mi->font).pointSizeF());
p->setFont(myFont);
p->drawText(xpos, yPos, contentRect.width() - xm - tabwidth + 1,
contentRect.height(), text_flags ^ Qt::AlignRight, s);
diff --git a/src/gui/styles/qmacstylepixmaps_mac_p.h b/src/gui/styles/qmacstylepixmaps_mac_p.h
index b404256..6a5e0e6 100644
--- a/src/gui/styles/qmacstylepixmaps_mac_p.h
+++ b/src/gui/styles/qmacstylepixmaps_mac_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qmotifstyle.cpp b/src/gui/styles/qmotifstyle.cpp
index b65d45c..9d67c28 100644
--- a/src/gui/styles/qmotifstyle.cpp
+++ b/src/gui/styles/qmotifstyle.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qmotifstyle.h b/src/gui/styles/qmotifstyle.h
index 521f218..1fbf22f 100644
--- a/src/gui/styles/qmotifstyle.h
+++ b/src/gui/styles/qmotifstyle.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qmotifstyle_p.h b/src/gui/styles/qmotifstyle_p.h
index 483df6e..28a4054 100644
--- a/src/gui/styles/qmotifstyle_p.h
+++ b/src/gui/styles/qmotifstyle_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qplastiquestyle.cpp b/src/gui/styles/qplastiquestyle.cpp
index be4fff2..9f69fd8 100644
--- a/src/gui/styles/qplastiquestyle.cpp
+++ b/src/gui/styles/qplastiquestyle.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qplastiquestyle.h b/src/gui/styles/qplastiquestyle.h
index 4a889c7..5ee65fa 100644
--- a/src/gui/styles/qplastiquestyle.h
+++ b/src/gui/styles/qplastiquestyle.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qproxystyle.cpp b/src/gui/styles/qproxystyle.cpp
index 929bcfe..5235350 100644
--- a/src/gui/styles/qproxystyle.cpp
+++ b/src/gui/styles/qproxystyle.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qproxystyle.h b/src/gui/styles/qproxystyle.h
index fa31342..5b43a69 100644
--- a/src/gui/styles/qproxystyle.h
+++ b/src/gui/styles/qproxystyle.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qproxystyle_p.h b/src/gui/styles/qproxystyle_p.h
index 60dad67..b5039cc 100644
--- a/src/gui/styles/qproxystyle_p.h
+++ b/src/gui/styles/qproxystyle_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index d78ea21..ca0b8c7 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -343,7 +343,8 @@ bool QS60StylePrivate::drawsOwnThemeBackground(const QWidget *widget)
}
QFont QS60StylePrivate::s60Font(
- QS60StyleEnums::FontCategories fontCategory, int pointSize) const
+ QS60StyleEnums::FontCategories fontCategory,
+ int pointSize, bool resolveFontSize) const
{
QFont result;
int actualPointSize = pointSize;
@@ -356,7 +357,7 @@ QFont QS60StylePrivate::s60Font(
Q_ASSERT(actualPointSize > 0);
const QPair<QS60StyleEnums::FontCategories, int> key(fontCategory, actualPointSize);
if (!m_mappedFontsCache.contains(key)) {
- result = s60Font_specific(fontCategory, actualPointSize);
+ result = s60Font_specific(fontCategory, actualPointSize, resolveFontSize);
m_mappedFontsCache.insert(key, result);
} else {
result = m_mappedFontsCache.value(key);
@@ -620,8 +621,10 @@ void QS60StylePrivate::setFont(QWidget *widget) const
fontCategory = QS60StyleEnums::FC_Title;
}
if (fontCategory != QS60StyleEnums::FC_Undefined) {
+ const bool resolveFontSize = widget->testAttribute(Qt::WA_SetFont)
+ && (widget->font().resolve() & QFont::SizeResolved);
const QFont suggestedFont =
- s60Font(fontCategory, widget->font().pointSizeF());
+ s60Font(fontCategory, widget->font().pointSizeF(), resolveFontSize);
widget->setFont(suggestedFont);
}
}
diff --git a/src/gui/styles/qs60style.h b/src/gui/styles/qs60style.h
index cd63431..adcb313 100644
--- a/src/gui/styles/qs60style.h
+++ b/src/gui/styles/qs60style.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h
index 65d7574..1417552 100644
--- a/src/gui/styles/qs60style_p.h
+++ b/src/gui/styles/qs60style_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -401,7 +401,7 @@ public:
static bool drawsOwnThemeBackground(const QWidget *widget);
QFont s60Font(QS60StyleEnums::FontCategories fontCategory,
- int pointSize = -1) const;
+ int pointSize = -1, bool resolveFontSize = true) const;
// clears all style caches (fonts, colors, pixmaps)
void clearCaches(CacheClearReason reason = CC_UndefinedChange);
@@ -484,7 +484,8 @@ private:
static QPixmap part(QS60StyleEnums::SkinParts part, const QSize &size,
QPainter *painter, SkinElementFlags flags = KDefaultSkinElementFlags);
- static QFont s60Font_specific(QS60StyleEnums::FontCategories fontCategory, int pointSize);
+ static QFont s60Font_specific(QS60StyleEnums::FontCategories fontCategory,
+ int pointSize, bool resolveFontSize);
static QSize screenSize();
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index fb9665a..be61073 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -909,8 +909,11 @@ TAknsItemID QS60StyleModeSpecifics::partSpecificThemeId(int part)
}
QFont QS60StylePrivate::s60Font_specific(
- QS60StyleEnums::FontCategories fontCategory, int pointSize)
+ QS60StyleEnums::FontCategories fontCategory,
+ int pointSize, bool resolveFontSize)
{
+ Q_UNUSED(resolveFontSize);
+
TAknFontCategory aknFontCategory = EAknFontCategoryUndefined;
switch (fontCategory) {
case QS60StyleEnums::FC_Primary:
diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp
index e49854f..bd43eb7 100644
--- a/src/gui/styles/qs60style_simulated.cpp
+++ b/src/gui/styles/qs60style_simulated.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -342,10 +342,13 @@ bool QS60StylePrivate::hasSliderGrooveGraphic()
return false;
}
-QFont QS60StylePrivate::s60Font_specific(QS60StyleEnums::FontCategories fontCategory, int pointSize)
+QFont QS60StylePrivate::s60Font_specific(
+ QS60StyleEnums::FontCategories fontCategory,
+ int pointSize, bool resolveFontSize)
{
QFont result;
- result.setPointSize(pointSize);
+ if (resolveFontSize)
+ result.setPointSize(pointSize);
switch (fontCategory) {
case QS60StyleEnums::FC_Primary:
result.setBold(true);
diff --git a/src/gui/styles/qstyle.cpp b/src/gui/styles/qstyle.cpp
index ec238a9..429dafe 100644
--- a/src/gui/styles/qstyle.cpp
+++ b/src/gui/styles/qstyle.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qstyle.h b/src/gui/styles/qstyle.h
index 0014954..439d626 100644
--- a/src/gui/styles/qstyle.h
+++ b/src/gui/styles/qstyle.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qstyle_p.h b/src/gui/styles/qstyle_p.h
index 5fea5b4..4729032 100644
--- a/src/gui/styles/qstyle_p.h
+++ b/src/gui/styles/qstyle_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qstylefactory.cpp b/src/gui/styles/qstylefactory.cpp
index e5b1f67..0dbb21f 100644
--- a/src/gui/styles/qstylefactory.cpp
+++ b/src/gui/styles/qstylefactory.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qstylefactory.h b/src/gui/styles/qstylefactory.h
index 3aa41ae..e5d2301 100644
--- a/src/gui/styles/qstylefactory.h
+++ b/src/gui/styles/qstylefactory.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qstylehelper.cpp b/src/gui/styles/qstylehelper.cpp
index f5af960..071ec23 100644
--- a/src/gui/styles/qstylehelper.cpp
+++ b/src/gui/styles/qstylehelper.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qstylehelper_p.h b/src/gui/styles/qstylehelper_p.h
index 3c37b66..31cc4ed 100644
--- a/src/gui/styles/qstylehelper_p.h
+++ b/src/gui/styles/qstylehelper_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qstyleoption.cpp b/src/gui/styles/qstyleoption.cpp
index 9188ee0..c057a2b 100644
--- a/src/gui/styles/qstyleoption.cpp
+++ b/src/gui/styles/qstyleoption.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -2826,8 +2826,9 @@ QStyleOptionComplex::QStyleOptionComplex(int version, int type)
/*!
\variable QStyleOptionComplex::subControls
- \brief a bitwise OR of the various sub-controls that need to be
- drawn for the complex control
+
+ This variable holds a bitwise OR of the \l{QStyle::SubControl}
+ {sub-controls} to be drawn for the complex control.
The default value is QStyle::SC_All.
@@ -2836,8 +2837,9 @@ QStyleOptionComplex::QStyleOptionComplex(int version, int type)
/*!
\variable QStyleOptionComplex::activeSubControls
- \brief a bitwise OR of the various sub-controls that are active
- (pressed) for the complex control
+
+ This variable holds a bitwise OR of the \l{QStyle::SubControl}
+ {sub-controls} that are active for the complex control.
The default value is QStyle::SC_None.
diff --git a/src/gui/styles/qstyleoption.h b/src/gui/styles/qstyleoption.h
index abd52bf..95de8d5 100644
--- a/src/gui/styles/qstyleoption.h
+++ b/src/gui/styles/qstyleoption.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qstyleplugin.cpp b/src/gui/styles/qstyleplugin.cpp
index 61dbaca..c961292 100644
--- a/src/gui/styles/qstyleplugin.cpp
+++ b/src/gui/styles/qstyleplugin.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qstyleplugin.h b/src/gui/styles/qstyleplugin.h
index 82cac52..7200351 100644
--- a/src/gui/styles/qstyleplugin.h
+++ b/src/gui/styles/qstyleplugin.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp
index ca6968b..dab93a2 100644
--- a/src/gui/styles/qstylesheetstyle.cpp
+++ b/src/gui/styles/qstylesheetstyle.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -5617,9 +5617,6 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c
case SE_ItemViewItemFocusRect:
if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(opt)) {
QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem);
- QStyleOptionViewItemV4 optCopy(*vopt);
- optCopy.rect = subRule.contentsRect(vopt->rect);
- QRect rect = ParentStyle::subElementRect(se, &optCopy, w);
PseudoElement pe = PseudoElement_None;
if (se == SE_ItemViewItemText || se == SE_ItemViewItemFocusRect)
pe = PseudoElement_ViewItemText;
@@ -5629,8 +5626,13 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c
pe = PseudoElement_ViewItemIndicator;
else
break;
- QRenderRule subRule2 = renderRule(w, opt, pe);
- return positionRect(w, subRule2, pe, rect, opt->direction);
+ if (subRule.hasGeometry() || subRule.hasBox() || !subRule.hasNativeBorder() || hasStyleRule(w, pe)) {
+ QRenderRule subRule2 = renderRule(w, opt, pe);
+ QStyleOptionViewItemV4 optCopy(*vopt);
+ optCopy.rect = subRule.contentsRect(vopt->rect);
+ QRect rect = ParentStyle::subElementRect(se, &optCopy, w);
+ return positionRect(w, subRule2, pe, rect, opt->direction);
+ }
}
break;
#endif // QT_NO_ITEMVIEWS
diff --git a/src/gui/styles/qstylesheetstyle_default.cpp b/src/gui/styles/qstylesheetstyle_default.cpp
index f79f8e0..270b68d 100644
--- a/src/gui/styles/qstylesheetstyle_default.cpp
+++ b/src/gui/styles/qstylesheetstyle_default.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qstylesheetstyle_p.h b/src/gui/styles/qstylesheetstyle_p.h
index 6ced277..50abef9 100644
--- a/src/gui/styles/qstylesheetstyle_p.h
+++ b/src/gui/styles/qstylesheetstyle_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qwindowscestyle.cpp b/src/gui/styles/qwindowscestyle.cpp
index e5dbabd..b027005 100644
--- a/src/gui/styles/qwindowscestyle.cpp
+++ b/src/gui/styles/qwindowscestyle.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qwindowscestyle.h b/src/gui/styles/qwindowscestyle.h
index dabb320..2b1fab8 100644
--- a/src/gui/styles/qwindowscestyle.h
+++ b/src/gui/styles/qwindowscestyle.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qwindowscestyle_p.h b/src/gui/styles/qwindowscestyle_p.h
index 07fdc7e..0b11049 100644
--- a/src/gui/styles/qwindowscestyle_p.h
+++ b/src/gui/styles/qwindowscestyle_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qwindowsmobilestyle.cpp b/src/gui/styles/qwindowsmobilestyle.cpp
index 86ba947..a264b1b 100644
--- a/src/gui/styles/qwindowsmobilestyle.cpp
+++ b/src/gui/styles/qwindowsmobilestyle.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qwindowsmobilestyle.h b/src/gui/styles/qwindowsmobilestyle.h
index 99baf1b..e9967e5 100644
--- a/src/gui/styles/qwindowsmobilestyle.h
+++ b/src/gui/styles/qwindowsmobilestyle.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qwindowsmobilestyle_p.h b/src/gui/styles/qwindowsmobilestyle_p.h
index 139a4ab..8724000 100644
--- a/src/gui/styles/qwindowsmobilestyle_p.h
+++ b/src/gui/styles/qwindowsmobilestyle_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qwindowsstyle.cpp b/src/gui/styles/qwindowsstyle.cpp
index 0a59d6d..6c48590 100644
--- a/src/gui/styles/qwindowsstyle.cpp
+++ b/src/gui/styles/qwindowsstyle.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qwindowsstyle.h b/src/gui/styles/qwindowsstyle.h
index 359e828..34a5d25 100644
--- a/src/gui/styles/qwindowsstyle.h
+++ b/src/gui/styles/qwindowsstyle.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qwindowsstyle_p.h b/src/gui/styles/qwindowsstyle_p.h
index d81c82b..808abe1 100644
--- a/src/gui/styles/qwindowsstyle_p.h
+++ b/src/gui/styles/qwindowsstyle_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp
index 9f5440c..67a7b85 100644
--- a/src/gui/styles/qwindowsvistastyle.cpp
+++ b/src/gui/styles/qwindowsvistastyle.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qwindowsvistastyle.h b/src/gui/styles/qwindowsvistastyle.h
index 6bf4e0c..5faf774 100644
--- a/src/gui/styles/qwindowsvistastyle.h
+++ b/src/gui/styles/qwindowsvistastyle.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qwindowsvistastyle_p.h b/src/gui/styles/qwindowsvistastyle_p.h
index 04823c1..673568d 100644
--- a/src/gui/styles/qwindowsvistastyle_p.h
+++ b/src/gui/styles/qwindowsvistastyle_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp
index 50be342..efb1224 100644
--- a/src/gui/styles/qwindowsxpstyle.cpp
+++ b/src/gui/styles/qwindowsxpstyle.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qwindowsxpstyle.h b/src/gui/styles/qwindowsxpstyle.h
index b4c87ed..6b77f6c 100644
--- a/src/gui/styles/qwindowsxpstyle.h
+++ b/src/gui/styles/qwindowsxpstyle.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/src/gui/styles/qwindowsxpstyle_p.h b/src/gui/styles/qwindowsxpstyle_p.h
index 652d0e1..0a13a52 100644
--- a/src/gui/styles/qwindowsxpstyle_p.h
+++ b/src/gui/styles/qwindowsxpstyle_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**