diff options
Diffstat (limited to 'src/gui/styles')
-rw-r--r-- | src/gui/styles/qcleanlooksstyle.cpp | 1 | ||||
-rw-r--r-- | src/gui/styles/qgtkstyle.cpp | 44 | ||||
-rw-r--r-- | src/gui/styles/qgtkstyle_p.cpp | 62 | ||||
-rw-r--r-- | src/gui/styles/qgtkstyle_p.h | 19 | ||||
-rw-r--r-- | src/gui/styles/qplastiquestyle.cpp | 10 | ||||
-rw-r--r-- | src/gui/styles/qs60style.cpp | 21 | ||||
-rw-r--r-- | src/gui/styles/qs60style.h | 2 | ||||
-rw-r--r-- | src/gui/styles/qs60style_p.h | 2 | ||||
-rw-r--r-- | src/gui/styles/qs60style_s60.cpp | 2 | ||||
-rw-r--r-- | src/gui/styles/qs60style_simulated.cpp | 2 | ||||
-rw-r--r-- | src/gui/styles/qstyleoption.cpp | 13 | ||||
-rw-r--r-- | src/gui/styles/qstylesheetstyle.cpp | 10 |
12 files changed, 122 insertions, 66 deletions
diff --git a/src/gui/styles/qcleanlooksstyle.cpp b/src/gui/styles/qcleanlooksstyle.cpp index 973e682..b08847d 100644 --- a/src/gui/styles/qcleanlooksstyle.cpp +++ b/src/gui/styles/qcleanlooksstyle.cpp @@ -3817,6 +3817,7 @@ QSize QCleanlooksStyle::sizeFromContents(ContentsType type, const QStyleOption * newSize.setWidth(80); if (!btn->icon.isNull() && btn->iconSize.height() > 16) newSize -= QSize(0, 2); + newSize += QSize(0, 1); } if (const QPushButton *button = qobject_cast<const QPushButton *>(widget)) { if (qobject_cast<const QDialogButtonBox *>(button->parentWidget())) { diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index 1c78a47..5566cc6 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -127,11 +127,19 @@ static const int groupBoxBottomMargin = 2; // space below the groupbox static const int groupBoxTitleMargin = 6; // space between contents and title static const int groupBoxTopMargin = 2; +/*! + Returns the configuration string for \a value. + Returns \a fallback if \a value is not found. + */ QString QGtkStyle::getGConfString(const QString &value, const QString &fallback) { return QGtkStylePrivate::getGConfString(value, fallback); } +/*! + Returns the configuration boolean for \a key. + Returns \a fallback if \a key is not found. + */ bool QGtkStyle::getGConfBool(const QString &key, bool fallback) { return QGtkStylePrivate::getGConfBool(key, fallback); @@ -2513,7 +2521,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, -1, -1); + QRect rect = option->rect.adjusted(0, 0, 0, -1); #ifndef QT_NO_COMBOBOX if (qobject_cast<const QComboBox*>(widget)) rect = option->rect; @@ -2620,7 +2628,7 @@ void QGtkStyle::drawControl(ControlElement element, int pixw = pixmap.width(); int pixh = pixmap.height(); QRect pmr(0, 0, pixw, pixh); - pmr.moveCenter(vCheckRect.center()); + pmr.moveCenter(vCheckRect.center() - QPoint(0, 1)); painter->setPen(menuItem->palette.text().color()); if (!ignoreCheckMark && checkable && checked) { QStyleOption opt = *option; @@ -2662,8 +2670,8 @@ void QGtkStyle::drawControl(ControlElement element, menuitem->rect.getRect(&x, &y, &w, &h); int tab = menuitem->tabWidth; int xm = windowsItemFrame + checkcol + windowsItemHMargin; - int xpos = menuitem->rect.x() + xm; - QRect textRect(xpos, y + windowsItemVMargin, w - xm - windowsRightBorder - tab + 1, h - 2 * windowsItemVMargin); + int xpos = menuitem->rect.x() + xm + 1; + QRect textRect(xpos, y + windowsItemVMargin - 1, w - xm - windowsRightBorder - tab + 1, h - 2 * windowsItemVMargin); QRect vTextRect = visualRect(opt->direction, menuitem->rect, textRect); QString s = menuitem->text; @@ -2710,13 +2718,19 @@ void QGtkStyle::drawControl(ControlElement element, QFontMetrics fm(menuitem->font); int arrow_size = fm.ascent() + fm.descent() - 2 * gtkMenuItem->style->ythickness; gfloat arrow_scaling = 0.8; + int extra = 0; + if (!d->gtk_check_version(2, 16, 0)) { + // "arrow-scaling" is actually hardcoded and fails on hardy (see gtk+-2.12/gtkmenuitem.c) + // though the current documentation states otherwise + d->gtk_widget_style_get(gtkMenuItem, "arrow-scaling", &arrow_scaling, NULL); + // in versions < 2.16 ythickness was previously subtracted from the arrow_size + extra = 2 * gtkMenuItem->style->ythickness; + } - // "arrow-scaling" is actually hardcoded and fails on hardy (see gtk+-2.12/gtkmenuitem.c) - // though the current documentation states otherwise int horizontal_padding; d->gtk_widget_style_get(gtkMenuItem, "horizontal-padding", &horizontal_padding, NULL); - const int dim = static_cast<int>(arrow_size * arrow_scaling); + const int dim = static_cast<int>(arrow_size * arrow_scaling) + extra; int xpos = menuItem->rect.left() + menuItem->rect.width() - horizontal_padding - dim; QRect vSubMenuRect = visualRect(option->direction, menuItem->rect, QRect(xpos, menuItem->rect.top() + @@ -3115,7 +3129,7 @@ QSize QGtkStyle::sizeFromContents(ContentsType type, const QStyleOption *option, case CT_ToolButton: if (const QStyleOptionToolButton *toolbutton = qstyleoption_cast<const QStyleOptionToolButton *>(option)) { GtkWidget *gtkButton = d->gtkWidget(QLS("GtkToolButton.GtkButton")); - newSize = size + QSize(2 * gtkButton->style->xthickness, 1 + 2 * gtkButton->style->ythickness); + newSize = size + QSize(2 * gtkButton->style->xthickness, 2 + 2 * gtkButton->style->ythickness); if (widget && qobject_cast<QToolBar *>(widget->parentWidget())) { QSize minSize(0, 25); if (toolbutton->toolButtonStyle != Qt::ToolButtonTextOnly) @@ -3147,7 +3161,7 @@ QSize QGtkStyle::sizeFromContents(ContentsType type, const QStyleOption *option, GtkWidget *gtkMenuItem = d->gtkWidget(QLS("GtkMenu.GtkMenuItem")); GtkStyle* style = gtkMenuItem->style; - newSize += QSize(textMargin + style->xthickness - 2, style->ythickness - 4); + newSize += QSize(textMargin + style->xthickness - 1, style->ythickness - 3); // Cleanlooks assumes a check column of 20 pixels so we need to // expand it a bit @@ -3167,7 +3181,7 @@ QSize QGtkStyle::sizeFromContents(ContentsType type, const QStyleOption *option, case CT_SpinBox: // QSpinBox does some nasty things that depends on CT_LineEdit - newSize = size + QSize(0, -d->gtkWidget(QLS("GtkSpinButton"))->style->ythickness * 2 + 2); + newSize = size + QSize(0, -d->gtkWidget(QLS("GtkSpinButton"))->style->ythickness * 2); break; case CT_PushButton: @@ -3198,13 +3212,9 @@ QSize QGtkStyle::sizeFromContents(ContentsType type, const QStyleOption *option, } break; - case CT_MenuBarItem://cleanlooks adds 2 pixels - newSize = QWindowsStyle::sizeFromContents(type, option, size, widget) + QSize(0, 1); - break; - case CT_LineEdit: { GtkWidget *gtkEntry = d->gtkWidget(QLS("GtkEntry")); - newSize = size + QSize(2*gtkEntry->style->xthickness, 2*gtkEntry->style->ythickness); + newSize = size + QSize(2*gtkEntry->style->xthickness, 2 + 2*gtkEntry->style->ythickness); } break; @@ -3219,7 +3229,7 @@ QSize QGtkStyle::sizeFromContents(ContentsType type, const QStyleOption *option, newSize = size + QSize(12 + arrowButtonRect.width() + 2*gtkCombo->style->xthickness, 4 + 2*gtkCombo->style->ythickness); if (!(widget && qobject_cast<QToolBar *>(widget->parentWidget()))) - newSize += QSize(0, 3); + newSize += QSize(0, 2); } break; @@ -3232,7 +3242,7 @@ QSize QGtkStyle::sizeFromContents(ContentsType type, const QStyleOption *option, if (!tab->icon.isNull()) newSize += QSize(6, 0); } - newSize += QSize(1, 0); + newSize += QSize(1, 1); break; default: diff --git a/src/gui/styles/qgtkstyle_p.cpp b/src/gui/styles/qgtkstyle_p.cpp index 7119a4f..5f4ebae 100644 --- a/src/gui/styles/qgtkstyle_p.cpp +++ b/src/gui/styles/qgtkstyle_p.cpp @@ -202,12 +202,16 @@ Ptr_gnome_vfs_init QGtkStylePrivate::gnome_vfs_init = 0; typedef int (*x11ErrorHandler)(Display*, XErrorEvent*); -static void gtkStyleSetCallback(GtkWidget*, QGtkStylePrivate* stylePrivate) +Q_DECLARE_METATYPE(QGtkStylePrivate*); + +static void gtkStyleSetCallback(GtkWidget*) { + qRegisterMetaType<QGtkStylePrivate *>(); + // We have to let this function return and complete the event // loop to ensure that all gtk widgets have been styled before // updating - QMetaObject::invokeMethod(styleScheduler(), "updateTheme", Qt::QueuedConnection, Q_ARG(QGtkStylePrivate*, stylePrivate)); + QMetaObject::invokeMethod(styleScheduler(), "updateTheme", Qt::QueuedConnection); } static void update_toolbar_style(GtkWidget *gtkToolBar, GParamSpec *, gpointer) @@ -251,10 +255,18 @@ bool QGtkStyleFilter::eventFilter(QObject *obj, QEvent *e) return QObject::eventFilter(obj, e); } +QList<QGtkStylePrivate *> QGtkStylePrivate::instances; + QGtkStylePrivate::QGtkStylePrivate() : QCleanlooksStylePrivate() , filter(this) { + instances.append(this); +} + +QGtkStylePrivate::~QGtkStylePrivate() +{ + instances.removeOne(this); } void QGtkStylePrivate::init() @@ -285,7 +297,7 @@ GtkStyle* QGtkStylePrivate::gtkStyle(const QString &path) /*! \internal * Get references to gtk functions after we dynamically load the library. */ -void QGtkStylePrivate::resolveGtk() +void QGtkStylePrivate::resolveGtk() const { // enforce the "0" suffix, so we'll open libgtk-x11-2.0.so.0 QLibrary libgtk(QLS("gtk-x11-2.0"), 0, 0); @@ -413,7 +425,7 @@ void QGtkStylePrivate::resolveGtk() * Initializes a number of gtk menu widgets. * The widgets are cached. */ -void QGtkStylePrivate::initGtkMenu() +void QGtkStylePrivate::initGtkMenu() const { // Create menubar GtkWidget *gtkMenuBar = QGtkStylePrivate::gtk_menu_bar_new(); @@ -444,7 +456,7 @@ void QGtkStylePrivate::initGtkMenu() } -void QGtkStylePrivate::initGtkTreeview() +void QGtkStylePrivate::initGtkTreeview() const { GtkWidget *gtkTreeView = gtk_tree_view_new(); gtk_tree_view_append_column((GtkTreeView*)gtkTreeView, gtk_tree_view_column_new()); @@ -458,7 +470,7 @@ void QGtkStylePrivate::initGtkTreeview() * Initializes a number of gtk widgets that we can later on use to determine some of our styles. * The widgets are cached. */ -void QGtkStylePrivate::initGtkWidgets() +void QGtkStylePrivate::initGtkWidgets() const { // From gtkmain.c uid_t ruid = getuid (); @@ -509,7 +521,7 @@ void QGtkStylePrivate::initGtkWidgets() if (!gtkWidgetMap()->contains(QLS("GtkButton"))) { GtkWidget *gtkButton = QGtkStylePrivate::gtk_button_new(); addWidget(gtkButton); - g_signal_connect(gtkButton, "style-set", G_CALLBACK(gtkStyleSetCallback), this); + g_signal_connect(gtkButton, "style-set", G_CALLBACK(gtkStyleSetCallback), 0); addWidget(QGtkStylePrivate::gtk_tool_button_new(NULL, NULL)); addWidget(QGtkStylePrivate::gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_NONE)); addWidget(QGtkStylePrivate::gtk_hbutton_box_new()); @@ -613,7 +625,7 @@ bool QGtkStylePrivate::getGConfBool(const QString &key, bool fallback) return retVal; } -QString QGtkStylePrivate::getThemeName() const +QString QGtkStylePrivate::getThemeName() { QString themeName; // We try to parse the gtkrc file first @@ -730,7 +742,7 @@ void QGtkStylePrivate::addAllSubWidgets(GtkWidget *widget, gpointer v) } // Updates window/windowtext palette based on the indicated gtk widget -QPalette QGtkStylePrivate::gtkWidgetPalette(const QString >kWidgetName) +QPalette QGtkStylePrivate::gtkWidgetPalette(const QString >kWidgetName) const { GtkWidget *gtkWidget = QGtkStylePrivate::gtkWidget(gtkWidgetName); Q_ASSERT(gtkWidget); @@ -751,7 +763,7 @@ QPalette QGtkStylePrivate::gtkWidgetPalette(const QString >kWidgetName) } -void QGtkStyleUpdateScheduler::updateTheme( QGtkStylePrivate* stylePrivate ) +void QGtkStyleUpdateScheduler::updateTheme() { static QString oldTheme(QLS("qt_not_set")); QPixmapCache::clear(); @@ -760,20 +772,22 @@ void QGtkStyleUpdateScheduler::updateTheme( QGtkStylePrivate* stylePrivate ) if (QApplication::font() != font) qApp->setFont(font); - if (oldTheme != stylePrivate->getThemeName()) { - oldTheme = stylePrivate->getThemeName(); - QPalette newPalette = qApp->style()->standardPalette(); - QApplicationPrivate::setSystemPalette(newPalette); - QApplication::setPalette(newPalette); - stylePrivate->initGtkWidgets(); - stylePrivate->applyCustomPaletteHash(); - QList<QWidget*> widgets = QApplication::allWidgets(); - // Notify all widgets that size metrics might have changed - foreach (QWidget *widget, widgets) { - QEvent e(QEvent::StyleChange); - QApplication::sendEvent(widget, &e); - } - } + if (oldTheme != QGtkStylePrivate::getThemeName()) { + oldTheme = QGtkStylePrivate::getThemeName(); + QPalette newPalette = qApp->style()->standardPalette(); + QApplicationPrivate::setSystemPalette(newPalette); + QApplication::setPalette(newPalette); + if (!QGtkStylePrivate::instances.isEmpty()) { + QGtkStylePrivate::instances.last()->initGtkWidgets(); + QGtkStylePrivate::instances.last()->applyCustomPaletteHash(); + } + QList<QWidget*> widgets = QApplication::allWidgets(); + // Notify all widgets that size metrics might have changed + foreach (QWidget *widget, widgets) { + QEvent e(QEvent::StyleChange); + QApplication::sendEvent(widget, &e); + } + } QIconLoader::instance()->updateSystemTheme(); } diff --git a/src/gui/styles/qgtkstyle_p.h b/src/gui/styles/qgtkstyle_p.h index fa16769..f6ab8a3 100644 --- a/src/gui/styles/qgtkstyle_p.h +++ b/src/gui/styles/qgtkstyle_p.h @@ -255,16 +255,17 @@ class QGtkStylePrivate : public QCleanlooksStylePrivate Q_DECLARE_PUBLIC(QGtkStyle) public: QGtkStylePrivate(); + ~QGtkStylePrivate(); QGtkStyleFilter filter; static GtkWidget* gtkWidget(const QString &path); static GtkStyle* gtkStyle(const QString &path = QLatin1String("GtkWindow")); - virtual void resolveGtk(); - virtual void initGtkMenu(); - virtual void initGtkTreeview(); - virtual void initGtkWidgets(); + virtual void resolveGtk() const; + virtual void initGtkMenu() const; + virtual void initGtkTreeview() const; + virtual void initGtkWidgets() const; static void cleanupGtkWidgets(); @@ -276,7 +277,7 @@ public: static bool getGConfBool(const QString &key, bool fallback = 0); static QString getGConfString(const QString &key, const QString &fallback = QString()); - virtual QString getThemeName() const; + static QString getThemeName(); virtual int getSpinboxArrowSize() const; static void setupGtkFileChooser(GtkWidget* gtkFileChooser, QWidget *parent, @@ -412,7 +413,7 @@ public: static Ptr_gnome_icon_lookup_sync gnome_icon_lookup_sync; static Ptr_gnome_vfs_init gnome_vfs_init; - virtual QPalette gtkWidgetPalette(const QString >kWidgetName); + virtual QPalette gtkWidgetPalette(const QString >kWidgetName) const; protected: typedef QHash<QString, GtkWidget*> WidgetMap; @@ -434,6 +435,10 @@ protected: static void addWidget(GtkWidget *widget); virtual void init(); + +private: + static QList<QGtkStylePrivate *> instances; + friend class QGtkStyleUpdateScheduler; }; // Helper to ensure that we have polished all our gtk widgets @@ -442,7 +447,7 @@ class QGtkStyleUpdateScheduler : public QObject { Q_OBJECT public slots: - void updateTheme( QGtkStylePrivate* stylePrivate ); + void updateTheme(); }; QT_END_NAMESPACE diff --git a/src/gui/styles/qplastiquestyle.cpp b/src/gui/styles/qplastiquestyle.cpp index f880351..be4fff2 100644 --- a/src/gui/styles/qplastiquestyle.cpp +++ b/src/gui/styles/qplastiquestyle.cpp @@ -1094,8 +1094,6 @@ void QPlastiqueStyle::drawPrimitive(PrimitiveElement element, const QStyleOption QColor borderColor = option->palette.background().color().darker(178); QColor gradientStartColor = option->palette.button().color().lighter(104); QColor gradientStopColor = option->palette.button().color().darker(105); - QColor baseGradientStartColor = option->palette.base().color().darker(101); - QColor baseGradientStopColor = option->palette.base().color().darker(106); QColor highlightedGradientStartColor = option->palette.button().color().lighter(101); QColor highlightedGradientStopColor = mergedColors(option->palette.button().color(), option->palette.highlight().color(), 85); QColor highlightedBaseGradientStartColor = option->palette.base().color(); @@ -1978,7 +1976,13 @@ void QPlastiqueStyle::drawPrimitive(PrimitiveElement element, const QStyleOption QRect gradientRect(adjustedRect.left() + 1, adjustedRect.top() + 1, adjustedRect.right() - adjustedRect.left() - 1, adjustedRect.bottom() - adjustedRect.top() - 1); - qt_plastique_draw_gradient(painter, gradientRect, baseGradientStartColor, baseGradientStopColor); + if (option->palette.base().style() == Qt::SolidPattern) { + QColor baseGradientStartColor = option->palette.base().color().darker(101); + QColor baseGradientStopColor = option->palette.base().color().darker(106); + qt_plastique_draw_gradient(painter, gradientRect, baseGradientStartColor, baseGradientStopColor); + } else { + painter->fillRect(gradientRect, option->palette.base()); + } // draw "+" or "-" painter->setPen(alphaTextColor); painter->drawLine(center.x() - 2, center.y(), center.x() + 2, center.y()); diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 02ffb29..7c3e11f 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtGui of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -473,7 +473,7 @@ void QS60StylePrivate::setBackgroundTexture(QApplication *app) const Q_UNUSED(app) QPalette applicationPalette = QApplication::palette(); applicationPalette.setBrush(QPalette::Window, backgroundTexture()); - setThemePalette(app); + setThemePalette(&applicationPalette); } void QS60StylePrivate::deleteBackground() @@ -668,7 +668,7 @@ void QS60StylePrivate::setThemePalette(QPalette *palette) const s60Color(QS60StyleEnums::CL_QsnTextColors, 55, 0)); palette->setColor(QPalette::BrightText, palette->color(QPalette::WindowText).lighter()); palette->setColor(QPalette::HighlightedText, - s60Color(QS60StyleEnums::CL_QsnTextColors, 10, 0)); + s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0)); palette->setColor(QPalette::Link, s60Color(QS60StyleEnums::CL_QsnHighlightColors, 3, 0)); palette->setColor(QPalette::LinkVisited, palette->color(QPalette::Link).darker()); @@ -783,6 +783,14 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const widgetPalette.setBrush(QPalette::Window, QBrush()); QApplication::setPalette(widgetPalette, "QScrollArea"); widgetPalette = *palette; + + //Webpages should not use S60 theme colors as they are designed to work + //with themeBackground and do not generally mesh well with web page backgrounds. + QPalette webPalette = *palette; + webPalette.setColor(QPalette::WindowText, Qt::black); + webPalette.setColor(QPalette::Text, Qt::black); + QApplication::setPalette(webPalette, "QWebView"); + QApplication::setPalette(webPalette, "QGraphicsWebView"); } QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlags flags) @@ -799,6 +807,9 @@ QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlag case QS60StyleEnums::SP_QgnGrafTabPassiveR: case QS60StyleEnums::SP_QgnGrafTabPassiveL: case QS60StyleEnums::SP_QgnGrafTabActiveL: + //Returned QSize for tabs must not be square, but narrow rectangle with width:height + //ratio of 1:2 for horizontal tab bars (and 2:1 for vertical ones). + result.setWidth(10); break; case QS60StyleEnums::SP_QgnIndiSliderEdit: result.scale(pixelMetric(QStyle::PM_SliderLength), @@ -809,7 +820,7 @@ QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlag case QS60StyleEnums::SP_QgnGrafBarFrameSideR: result.setWidth(pixelMetric(PM_Custom_FrameCornerWidth)); break; - + case QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed: case QS60StyleEnums::SP_QsnCpScrollHandleTopPressed: case QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed: @@ -2004,7 +2015,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti buttonRect.adjust(0,-newY,0,-newY); painter->save(); - QColor themeColor = d->s60Color(QS60StyleEnums::CL_QsnIconColors, 13, option); + QColor themeColor = d->s60Color(QS60StyleEnums::CL_QsnTextColors, 6, option); QColor buttonTextColor = option->palette.buttonText().color(); if (themeColor != buttonTextColor) painter->setPen(buttonTextColor); diff --git a/src/gui/styles/qs60style.h b/src/gui/styles/qs60style.h index 885ea40..cd63431 100644 --- a/src/gui/styles/qs60style.h +++ b/src/gui/styles/qs60style.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtGui of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index b9789b9..cfe87ac 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtGui of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index b5f2d1c..a8dbf8d 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtGui of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index 4317483..55d5771 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtGui of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/gui/styles/qstyleoption.cpp b/src/gui/styles/qstyleoption.cpp index d73a563..9188ee0 100644 --- a/src/gui/styles/qstyleoption.cpp +++ b/src/gui/styles/qstyleoption.cpp @@ -4713,10 +4713,17 @@ QStyleOptionTabWidgetFrameV2::QStyleOptionTabWidgetFrameV2(int version) } +/*! \fn QStyleOptionTabWidgetFrameV2::QStyleOptionTabWidgetFrameV2(const QStyleOptionTabWidgetFrameV2 &other) + Constructs a QStyleOptionTabWidgetFrameV2 copy of the \a other style option. + + If the \a other style option's version is 1, the new style option's \l + selectedTabRect and tabBarRect will contain null rects + + \sa version +*/ + /*! - Constructs a QStyleOptionTabWidgetFrameV2 copy of the \a other style option - which can be either of the QStyleOptionTabWidgetFrameV2 or - QStyleOptionTabWidgetFrame types. + Constructs a QStyleOptionTabWidgetFrameV2 copy of the \a other style option. If the \a other style option's version is 1, the new style option's \l selectedTabRect and tabBarRect will contain null rects diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index ce73fd8..8b40931 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -1180,7 +1180,7 @@ void QRenderRule::drawBackgroundImage(QPainter *p, const QRect &rect, QPoint off QRect r = originRect(rect, background()->origin); QRect aligned = QStyle::alignedRect(Qt::LeftToRight, background()->position, bgp.size(), r); - QRect inter = aligned.intersected(r); + QRect inter = aligned.translated(-off).intersected(r); switch (background()->repeat) { case Repeat_Y: @@ -4637,6 +4637,7 @@ int QStyleSheetStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const } break; +#ifndef QT_NO_TABWIDGET case PM_TabBarTabHSpace: case PM_TabBarTabVSpace: subRule = renderRule(w, opt, PseudoElement_TabBarTab); @@ -4660,11 +4661,14 @@ int QStyleSheetStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const return 0; break; - case PM_TabBarBaseOverlap: - if (hasStyleRule(w->parentWidget(), PseudoElement_TabWidgetPane)) { + case PM_TabBarBaseOverlap: { + const QWidget *tabWidget = qobject_cast<const QTabWidget *>(w) ? w : w->parentWidget(); + if (hasStyleRule(tabWidget, PseudoElement_TabWidgetPane)) { return 0; } break; + } +#endif // QT_NO_TABWIDGET case PM_SliderThickness: // horizontal slider's height (sizeHint) case PM_SliderLength: // minimum length of slider |