aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divecartesianaxis.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/profile/divecartesianaxis.cpp')
-rw-r--r--qt-ui/profile/divecartesianaxis.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp
index 70be86334..55c5d7482 100644
--- a/qt-ui/profile/divecartesianaxis.cpp
+++ b/qt-ui/profile/divecartesianaxis.cpp
@@ -20,7 +20,8 @@ static QPen gridPen(){
return pen;
}
-void DiveCartesianAxis::setup(double minimum, double maximum, double interval, DiveCartesianAxis::Orientation o, qreal tick_size, const QPointF& pos)
+void DiveCartesianAxis::setup(double minimum, double maximum, double interval, double labelFontScale,
+ DiveCartesianAxis::Orientation o, qreal tick_size, const QPointF& pos)
{
setMinimum(minimum);
setMaximum(maximum);
@@ -28,6 +29,7 @@ void DiveCartesianAxis::setup(double minimum, double maximum, double interval, D
setOrientation(o);
setTickSize(tick_size);
setPos(pos);
+ setFontLabelScale(labelFontScale);
}
double DiveCartesianAxis::tickInterval() const
@@ -40,6 +42,11 @@ double DiveCartesianAxis::tickSize() const
return tick_size;
}
+void DiveCartesianAxis::setFontLabelScale(qreal scale)
+{
+ labelScale = scale;
+}
+
void DiveCartesianAxis::setMaximum(double maximum)
{
if (IS_FP_SAME(max, maximum))
@@ -67,6 +74,7 @@ DiveCartesianAxis::DiveCartesianAxis() : QObject(),
min(0),
max(0),
interval(1),
+ labelScale(1.0),
tick_size(0),
textVisibility(true)
{
@@ -164,7 +172,7 @@ void DiveCartesianAxis::updateTicks()
label->setText(textForValue(currValue));
label->setBrush(QBrush(textColor));
label->setBrush(colorForValue(currValue));
- label->setScale(0.8);
+ label->setScale(fontLabelScale());
labels.push_back(label);
if (orientation == RightToLeft || orientation == LeftToRight) {
label->setAlignment(Qt::AlignBottom | Qt::AlignHCenter);
@@ -262,6 +270,11 @@ double DiveCartesianAxis::minimum() const
return min;
}
+double DiveCartesianAxis::fontLabelScale() const
+{
+ return labelScale;
+}
+
void DiveCartesianAxis::setColor(const QColor& color)
{
QPen defaultPen(color);