diff options
author | Jens Bache-Wiig <jbache@trolltech.com> | 2010-04-20 09:56:37 (GMT) |
---|---|---|
committer | Jens Bache-Wiig <jbache@trolltech.com> | 2010-04-20 10:00:30 (GMT) |
commit | 7bec0ef0cd9ffb633586c820004607d2e3d66b07 (patch) | |
tree | 138adc0121a318985fd6e7b3b95363cf29404000 /src | |
parent | d8b3186319cf5a3d1cf3784fa93dd0cf114f8ab5 (diff) | |
download | Qt-7bec0ef0cd9ffb633586c820004607d2e3d66b07.zip Qt-7bec0ef0cd9ffb633586c820004607d2e3d66b07.tar.gz Qt-7bec0ef0cd9ffb633586c820004607d2e3d66b07.tar.bz2 |
Improve itemview appearance on Mac
This fixes two significant issues with the mac look and feel.
* Remove superfluous white inner border from item views.
This makes items fill all the way to the border.
* Remove double border for item view headers.
We now clip headers properly to make them blend with the
outer border.
Reviewed-by: Morten Sørvig
Task-number: QTBUG-10047
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/styles/qmacstyle_mac.mm | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 074dd89..f5b0b0c 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -2143,7 +2143,7 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW if (qstyleoption_cast<const QStyleOptionComboBox *>(opt) != 0) ret = 0; else - ret = QWindowsStyle::pixelMetric(metric, opt, widget); + ret = 1; break; case PM_MaximumDragDistance: ret = -1; @@ -3099,14 +3099,16 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai HIRect hirect = qt_hirectForQRect(opt->rect); HIThemeDrawButton(&hirect, &bi, cg, kHIThemeOrientationNormal, 0); break; } + case PE_Frame: { QPen oldPen = p->pen(); - QPen newPen; - newPen.setBrush(opt->palette.dark()); - p->setPen(newPen); + p->setPen(opt->palette.base().color().darker(140)); p->drawRect(opt->rect.adjusted(0, 0, -1, -1)); + p->setPen(opt->palette.base().color().darker(180)); + p->drawLine(opt->rect.topLeft(), opt->rect.topRight()); p->setPen(oldPen); break; } + case PE_FrameLineEdit: if (const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(opt)) { if (frame->state & State_Sunken) { @@ -3279,10 +3281,14 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter if (header->orientation == Qt::Horizontal){ switch (header->position) { case QStyleOptionHeader::Beginning: + ir.adjust(-1, -1, 0, 0); break; case QStyleOptionHeader::Middle: + ir.adjust(-1, -1, 0, 0); + break; + case QStyleOptionHeader::OnlyOneSection: case QStyleOptionHeader::End: - ir.adjust(-1, 0, 0, 0); + ir.adjust(-1, -1, 1, 0); break; default: break; |