Permalink
Browse files

Improved QxtSpanSlider's span drawing on Mac

  • Loading branch information...
1 parent 15e45d1 commit 6e0705be4b45a9dcdc09b1b3b49dbc05524767bc jpnurmi committed Feb 25, 2011
Showing with 3 additions and 7 deletions.
  1. +3 −7 src/gui/qxtspanslider.cpp
View
@@ -701,16 +701,12 @@ void QxtSpanSlider::paintEvent(QPaintEvent* event)
Q_UNUSED(event);
QStylePainter painter(this);
- // ticks
+ // groove & ticks
QStyleOptionSlider opt;
qxt_d().initStyleOption(&opt);
- opt.subControls = QStyle::SC_SliderTickmarks;
- painter.drawComplexControl(QStyle::CC_Slider, opt);
-
- // groove
opt.sliderValue = 0;
opt.sliderPosition = 0;
- opt.subControls = QStyle::SC_SliderGroove;
+ opt.subControls = QStyle::SC_SliderGroove | QStyle::SC_SliderTickmarks;
painter.drawComplexControl(QStyle::CC_Slider, opt);
// handle rects
@@ -724,7 +720,7 @@ void QxtSpanSlider::paintEvent(QPaintEvent* event)
// span
const int minv = qMin(lrv, urv);
const int maxv = qMax(lrv, urv);
- const QPoint c = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderGroove, this).center();
+ const QPoint c = QRect(lr.center(), ur.center()).center();
QRect spanRect;
if (orientation() == Qt::Horizontal)
spanRect = QRect(QPoint(minv, c.y() - 2), QPoint(maxv, c.y() + 1));

0 comments on commit 6e0705b

Please sign in to comment.