Better drawn 1-pixel thick splitter on Mac

Change-Id: I72effdfb997a7733fbbd270db719c163d1d53a66
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
Gabriel de Dietrich 2012-09-26 12:37:39 +02:00 committed by The Qt Project
parent fc0ad0aca2
commit 0fbb41dea7

View File

@ -4519,7 +4519,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
}
break;
}
case CE_Splitter: {
case CE_Splitter:
if (opt->rect.width() > 1 && opt->rect.height() > 1){
HIThemeSplitterDrawInfo sdi;
sdi.version = qt_mac_hitheme_version;
sdi.state = tds;
@ -4527,7 +4528,16 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
: kHIThemeSplitterAdornmentNone;
HIRect hirect = qt_hirectForQRect(opt->rect);
HIThemeDrawPaneSplitter(&hirect, &sdi, cg, kHIThemeOrientationNormal);
break; }
} else {
QPen oldPen = p->pen();
p->setPen(opt->palette.dark().color());
if (opt->state & QStyle::State_Horizontal)
p->drawLine(opt->rect.topLeft(), opt->rect.bottomLeft());
else
p->drawLine(opt->rect.topLeft(), opt->rect.topRight());
p->setPen(oldPen);
}
break;
case CE_RubberBand:
if (const QStyleOptionRubberBand *rubber = qstyleoption_cast<const QStyleOptionRubberBand *>(opt)) {
QColor fillColor(opt->palette.color(QPalette::Disabled, QPalette::Highlight));