summaryrefslogtreecommitdiffstats
path: root/src/gui/styles/qmacstyle_mac.mm
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@nokia.com>2010-01-25 15:04:11 (GMT)
committerPaul Olav Tvete <paul.tvete@nokia.com>2010-01-25 15:04:11 (GMT)
commit0411ecc38e6c48263de3e5fef2bd8ba3adf61d97 (patch)
treef555609fccea16128797b7951403ba9f459e9b62 /src/gui/styles/qmacstyle_mac.mm
parent5bda4e27bbe3fde98bd5c628fada76dfccadad0e (diff)
parentede20ecdb0ddef7ef239900eb3bfa92ca859e010 (diff)
downloadQt-0411ecc38e6c48263de3e5fef2bd8ba3adf61d97.zip
Qt-0411ecc38e6c48263de3e5fef2bd8ba3adf61d97.tar.gz
Qt-0411ecc38e6c48263de3e5fef2bd8ba3adf61d97.tar.bz2
Merge branch 'master' into staging-1-master
Conflicts: doc/src/getting-started/installation.qdoc
Diffstat (limited to 'src/gui/styles/qmacstyle_mac.mm')
-rw-r--r--src/gui/styles/qmacstyle_mac.mm24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index 0e0a9ca..083f730 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)
**
@@ -3109,6 +3109,18 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
break;
case PE_PanelLineEdit:
QWindowsStyle::drawPrimitive(pe, opt, p, w);
+ // Draw the focus frame for widgets other than QLineEdit (e.g. for line edits in Webkit).
+ // Focus frame is drawn outside the rectangle passed in the option-rect.
+ if (const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
+ if ((opt->state & State_HasFocus) && !qobject_cast<const QLineEdit*>(w)) {
+ int vmargin = pixelMetric(QStyle::PM_FocusFrameVMargin);
+ int hmargin = pixelMetric(QStyle::PM_FocusFrameHMargin);
+ QStyleOptionFrame focusFrame = *panel;
+ focusFrame.rect = panel->rect.adjusted(-hmargin, -vmargin, hmargin, vmargin);
+ drawControl(CE_FocusFrame, &focusFrame, p, w);
+ }
+ }
+
break;
case PE_FrameTabWidget:
if (const QStyleOptionTabWidgetFrame *twf
@@ -3995,7 +4007,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);
@@ -4842,9 +4854,11 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
uint sc = SC_TitleBarMinButton;
ThemeTitleBarWidget tbw = kThemeWidgetCollapseBox;
bool active = titlebar->state & State_Active;
- int border = 2;
- titleBarRect.origin.x += border;
- titleBarRect.origin.y -= border;
+ if (qMacVersion() < QSysInfo::MV_10_6) {
+ int border = 2;
+ titleBarRect.origin.x += border;
+ titleBarRect.origin.y -= border;
+ }
while (sc <= SC_TitleBarCloseButton) {
if (sc & titlebar->subControls) {