summaryrefslogtreecommitdiff
path: root/src/widgets/styles
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-02-06 14:21:16 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-02-07 13:07:25 +0100
commita1fe728fa5bd6cb9e50cf317a58efcf4eea4de2c (patch)
tree0798ae897d111147238544826c79243b6f9a48a4 /src/widgets/styles
parent57fe9bd2c6a361cf979d17d962abed5db17a1457 (diff)
parent65bd80ebfc1be81a196a861ade40ff874a3554f0 (diff)
downloadqtbase-a1fe728fa5bd6cb9e50cf317a58efcf4eea4de2c.tar.gz
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/gui/kernel/qguiapplication.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformintegration.cpp src/plugins/platforms/android/qandroidplatformintegration.h src/plugins/platforms/android/qandroidplatformopenglcontext.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/sql/doc/src/sql-driver.qdoc src/widgets/widgets/qtoolbararealayout.cpp Change-Id: Ifd7e58760c3cb6bd8a7d1dd32ef83b7ec190d41e
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qcommonstyle.cpp2
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm8
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp4
-rw-r--r--src/widgets/styles/qwindowsvistastyle.cpp6
4 files changed, 17 insertions, 3 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 2d7107598f..9c2163ac8f 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -1598,7 +1598,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
if (toolbutton->toolButtonStyle == Qt::ToolButtonTextUnderIcon) {
pr.setHeight(pmSize.height() + 6);
- tr.adjust(0, pr.height() - 1, 0, -2);
+ tr.adjust(0, pr.height() - 1, 0, -1);
pr.translate(shiftX, shiftY);
if (!hasArrow) {
proxy()->drawItemPixmap(p, pr, Qt::AlignCenter, pm);
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index d13339b555..fa49bcb884 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -2077,6 +2077,10 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
ret = 0;
break;
+ case PM_MenuBarPanelWidth:
+ ret = 0;
+ break;
+
case QStyle::PM_MenuDesktopFrameWidth:
ret = 5;
break;
@@ -6259,6 +6263,10 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
sz = QSize(w, h);
}
break;
+ case CT_MenuBarItem:
+ if (!sz.isEmpty())
+ sz += QSize(12, 4); // Constants from QWindowsStyle
+ break;
case CT_ToolButton:
sz.rwidth() += 10;
sz.rheight() += 10;
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 2f36e0e53c..6bd0ba37c8 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -4710,7 +4710,9 @@ int QStyleSheetStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const
break;
case PM_TabBarBaseOverlap: {
- const QWidget *tabWidget = qobject_cast<const QTabWidget *>(w) ? w : w->parentWidget();
+ const QWidget *tabWidget = qobject_cast<const QTabWidget *>(w);
+ if (!tabWidget && w)
+ tabWidget = w->parentWidget();
if (hasStyleRule(tabWidget, PseudoElement_TabWidgetPane)) {
return 0;
}
diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp
index 5827a01151..6c7b71bd74 100644
--- a/src/widgets/styles/qwindowsvistastyle.cpp
+++ b/src/widgets/styles/qwindowsvistastyle.cpp
@@ -1879,7 +1879,11 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle
XPThemeData ftheme(widget, painter,
QWindowsXPStylePrivate::EditTheme,
partId, stateId, r);
- ftheme.noContent = true;
+ // The spinbox in Windows QStyle is drawn with frameless QLineEdit inside it
+ // That however breaks with QtQuickControls where this results in transparent
+ // spinbox background, so if there's no "widget" passed (QtQuickControls case),
+ // let ftheme.noContent be false, which fixes the spinbox rendering in QQC
+ ftheme.noContent = (widget != NULL);
d->drawBackground(ftheme);
}
if (sub & SC_SpinBoxUp) {