diff --git a/src/gui/UBBackgroundPalette.cpp b/src/gui/UBBackgroundPalette.cpp index d7218154..b975b33d 100644 --- a/src/gui/UBBackgroundPalette.cpp +++ b/src/gui/UBBackgroundPalette.cpp @@ -189,9 +189,15 @@ void UBBackgroundPalette::backgroundChanged() bool dark = UBApplication::boardController->activeScene()->isDarkBackground(); if (dark) + { mSliderLabel->setStyleSheet("QLabel { color : white; }"); + mIntermediateLinesLabel->setStyleSheet("QLabel { color : white; }"); + } else + { mSliderLabel->setStyleSheet("QLabel { color : black; }"); + mIntermediateLinesLabel->setStyleSheet("QLabel { color : black; }"); + } } void UBBackgroundPalette::refresh() diff --git a/src/tools/UBGraphicsAxes.cpp b/src/tools/UBGraphicsAxes.cpp index 566e4b15..9fb6be2f 100644 --- a/src/tools/UBGraphicsAxes.cpp +++ b/src/tools/UBGraphicsAxes.cpp @@ -210,20 +210,20 @@ void UBGraphicsAxes::paintGraduations(QPainter *painter) QFontMetricsF fontMetrics(painter->font()); // Update the width of one "centimeter" to correspond to the width of the background grid (whether it is displayed or not) - sPixelsPerCentimeter = UBApplication::boardController->activeScene()->backgroundGridSize(); + mPixelsPerCentimeter = UBApplication::boardController->activeScene()->backgroundGridSize(); // When a "centimeter" is too narrow, we only display every 5th number double numbersWidth = fontMetrics.boundingRect("-00").width(); - bool shouldDisplayAllNumbers = (numbersWidth <= (sPixelsPerCentimeter - 5)); + bool shouldDisplayAllNumbers = (numbersWidth <= (mPixelsPerCentimeter - 5)); // draw numbers on x axis - int fromX = (xAxis().x1() + sMargin) / sPixelsPerCentimeter; - int toX = (xAxis().x2() - sMargin) / sPixelsPerCentimeter; + int fromX = (xAxis().x1() + sMargin) / mPixelsPerCentimeter; + int toX = (xAxis().x2() - sMargin) / mPixelsPerCentimeter; for (int centimeters(fromX); centimeters <= toX; centimeters++) { bool isImportant = abs(centimeters) == 1 || abs(centimeters) % 5 == 0; - double graduationX = sPixelsPerCentimeter * centimeters; + double graduationX = mPixelsPerCentimeter * centimeters; double graduationHeight = UBGeometryUtils::millimeterGraduationHeight; painter->drawLine(QLineF(graduationX, graduationHeight, graduationX, -graduationHeight)); @@ -244,13 +244,13 @@ void UBGraphicsAxes::paintGraduations(QPainter *painter) } // draw numbers on y axis - int fromY = (-yAxis().y1() + sMargin) / sPixelsPerCentimeter; - int toY = (-yAxis().y2() - sMargin) / sPixelsPerCentimeter; + int fromY = (-yAxis().y1() + sMargin) / mPixelsPerCentimeter; + int toY = (-yAxis().y2() - sMargin) / mPixelsPerCentimeter; for (int centimeters(fromY); centimeters <= toY; centimeters++) { bool isImportant = abs(centimeters) == 1 || abs(centimeters) % 5 == 0; - double graduationY = - sPixelsPerCentimeter * centimeters; + double graduationY = - mPixelsPerCentimeter * centimeters; double graduationHeight = UBGeometryUtils::millimeterGraduationHeight; painter->drawLine(QLineF(graduationHeight, graduationY, - graduationHeight, graduationY)); diff --git a/src/tools/UBGraphicsAxes.h b/src/tools/UBGraphicsAxes.h index c478800f..8edcd75c 100644 --- a/src/tools/UBGraphicsAxes.h +++ b/src/tools/UBGraphicsAxes.h @@ -114,14 +114,15 @@ class UBGraphicsAxes : public QObject, public QGraphicsPolygonItem, public UBIte bool mShowButtons; bool mShowNumbers; - QCursor mResizeCursorH; QCursor mResizeCursorV; - int drawLineDirection; + qreal mAntiScaleRatio; + qreal mPixelsPerCentimeter; + QRectF mBounds; // Constants - static const QRect sDefaultRect; + static const QRect sDefaultRect; static const int sMinLength = 50; // 1sm static const int sMaxLength = 35000; // 700sm @@ -132,11 +133,6 @@ class UBGraphicsAxes : public QObject, public QGraphicsPolygonItem, public UBIte static const int sDrawTransparency = 255; static const QColor sLightBackgroundDrawColor; static const QColor sDarkBackgroundDrawColor; - - qreal mStrokeWidth; - qreal mAntiScaleRatio; - qreal sPixelsPerCentimeter; - QRectF mBounds; }; #endif // UBGRAPHICSAXES_H