diff --git a/app/gui/oven_control/slider.cpp b/app/gui/oven_control/slider.cpp index 7bbab93..4bc62de 100644 --- a/app/gui/oven_control/slider.cpp +++ b/app/gui/oven_control/slider.cpp @@ -193,7 +193,7 @@ void Slider::mouseReleaseEvent(QMouseEvent */*event*/) void Slider::paintEvent(QPaintEvent */*event*/) { QPainter painter(this); - painter.drawPixmap(groovePoint, groove); + painter.drawPixmap(grooveLeftTop, groove); QPen tickPen(QColor(71, 71, 71)); tickPen.setWidth(2); @@ -202,36 +202,36 @@ void Slider::paintEvent(QPaintEvent */*event*/) if (tickInterval) for (int tick = minimum_; tick <= maximum_; tick += tickInterval) { - int x = subPoint.x() + calcSubLength(tick); - painter.drawLine(x, groovePoint.y() + 22, x, groovePoint.y() + 28); + int x = subLeftTop.x() + calcSubLength(tick); + painter.drawLine(x, grooveLeftTop.y() + 22, x, grooveLeftTop.y() + 28); } else foreach (int tick, ticks) { - int x = subPoint.x() + calcSubLength(tick); - painter.drawLine(x, groovePoint.y() + 22, x, groovePoint.y() + 28); + int x = subLeftTop.x() + calcSubLength(tick); + painter.drawLine(x, grooveLeftTop.y() + 22, x, grooveLeftTop.y() + 28); } if (bigTickInterval) for (int tick = minimum_; tick <= maximum_; tick += bigTickInterval) { - int x = subPoint.x() + calcSubLength(tick); - painter.drawLine(x, groovePoint.y() + 22, x, groovePoint.y() + 33); + int x = subLeftTop.x() + calcSubLength(tick); + painter.drawLine(x, grooveLeftTop.y() + 22, x, grooveLeftTop.y() + 33); } else foreach (int tick, bigTicks) { - int x = subPoint.x() + calcSubLength(tick); - painter.drawLine(x, groovePoint.y() + 22, x, groovePoint.y() + 33); + int x = subLeftTop.x() + calcSubLength(tick); + painter.drawLine(x, grooveLeftTop.y() + 22, x, grooveLeftTop.y() + 33); } if (subVisible_) { int subLength = calcSubLength(sliderPosition_); if (subLength > 0) - painter.drawPixmap(subPoint, sub, QRect(0, 0, subLength, sub.height())); + painter.drawPixmap(subLeftTop, sub, QRect(0, 0, subLength, sub.height())); - QPoint handlePoint(subPoint.x() + subLength - handle.width() / 2, (height() - handle.height()) / 2); + QPoint handlePoint(subLeftTop.x() + subLength - handle.width() / 2, (height() - handle.height()) / 2); painter.drawPixmap(handlePoint, handle); } } @@ -258,8 +258,8 @@ void Slider::updatePixmapPosition() minSliderX = (width() - sub.width()) / 2; maxSliderX = width() - minSliderX; - groovePoint = QPoint((width() - groove.width()) / 2, (height() - groove.height()) / 2); - subPoint = QPoint((width() - sub.width()) / 2, (height() - sub.height()) / 2); + grooveLeftTop = QPoint((width() - groove.width()) / 2, (height() - groove.height()) / 2); + subLeftTop = QPoint((width() - sub.width()) / 2, (height() - sub.height()) / 2); } void Slider::setValue(int value)