diff options
author | Gabriel de Dietrich <gabriel.dedietrich@digia.com> | 2014-03-12 16:49:50 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-22 18:27:29 (GMT) |
commit | db01f4ac1fd7bdcd6bc165971481c00d1d0141d0 (patch) | |
tree | 9162b4c1e3a41c821e857ba86966bedd1640abd6 /src/gui | |
parent | dfb80318cdd574205e6dd7780ad7688d7786da87 (diff) | |
download | Qt-db01f4ac1fd7bdcd6bc165971481c00d1d0141d0.zip Qt-db01f4ac1fd7bdcd6bc165971481c00d1d0141d0.tar.gz Qt-db01f4ac1fd7bdcd6bc165971481c00d1d0141d0.tar.bz2 |
Vista Style: More menu item pixel fixes for QtQuick Controls
Includes a one-pixel fix for widgets, where the menu item text
would be one pixel too far away from the vertical gutter.
Task-number: QTBUG-37451
Task-number: QTBUG-38376
Change-Id: I2539233814a427c5bed66a5c07584717eb3df418
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
(cherry picked from qtbase/9cd2dac348f45c4b93f74f8ebe20d7528821f003)
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/styles/qwindowsvistastyle.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp index 58dc1c4..c73424f 100644 --- a/src/gui/styles/qwindowsvistastyle.cpp +++ b/src/gui/styles/qwindowsvistastyle.cpp @@ -1272,7 +1272,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption QPoint p1 = QPoint(x + checkcol, yoff); QPoint p2 = QPoint(x + w + 6 , yoff); stateId = MBI_HOT; - QRect subRect(p1.x(), p1.y(), p2.x() - p1.x(), 6); + QRect subRect(p1.x() + (3 - menuitem->rect.x()), p1.y(), p2.x() - p1.x(), 6); subRect = QStyle::visualRect(option->direction, option->rect, subRect ); XPThemeData theme2(widget, painter, QLatin1String("MENU"), MENU_POPUPSEPARATOR, stateId, subRect); d->drawBackground(theme2); @@ -1341,7 +1341,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption if (dis) painter->setPen(textColor); - int xm = windowsItemFrame + checkcol + windowsItemHMargin; + int xm = windowsItemFrame + checkcol + windowsItemHMargin + (3 - menuitem->rect.x()) - 1; int xpos = menuitem->rect.x() + xm; QRect textRect(xpos, y + windowsItemVMargin, w - xm - windowsRightBorder - tab + 1, h - 2 * windowsItemVMargin); QRect vTextRect = visualRect(option->direction, menuitem->rect, textRect); |