diff --git a/Source/GUI/Plot.cpp b/Source/GUI/Plot.cpp index e8a23bd86..74ebc8c3d 100644 --- a/Source/GUI/Plot.cpp +++ b/Source/GUI/Plot.cpp @@ -437,6 +437,20 @@ bool Plot::isBarchart() const void Plot::setYAxisMinMaxMode(YMinMaxMode mode) { m_yminMaxMode = mode; + QColor color; + switch(m_yminMaxMode) { + case MinMaxOfThePlot: + color = "darkblue"; + break; + case Formula: + color = "black"; + break; + case Custom: + color = QColor(85, 0, 127); + break; + } + + setYAxisColor(color); initYAxis(); } @@ -732,6 +746,15 @@ QSize Plot::minimumSizeHint() const return QSize( hint.width(), -1 ); } +void Plot::setYAxisColor(QColor color) +{ + auto yAxis = axisWidget(QwtPlot::yLeft); + QPalette palette = yAxis->palette(); + palette.setColor(QPalette::WindowText, color); // for ticks + palette.setColor(QPalette::Text, color); // for ticks' labels + yAxis->setPalette(palette); +} + const QwtPlotCurve* Plot::curve( int index ) const { const QwtPlotItemList curves = itemList( QwtPlotItem::Rtti_PlotCurve ); diff --git a/Source/GUI/Plot.h b/Source/GUI/Plot.h index 3afcbc9ea..0a06d8987 100644 --- a/Source/GUI/Plot.h +++ b/Source/GUI/Plot.h @@ -453,6 +453,7 @@ class Plot : public QwtPlot virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; + void setYAxisColor(QColor color); void setYAxis( double min, double max, int numSteps ); void setCursorPos( double x ); diff --git a/Source/GUI/yminmaxselector.ui b/Source/GUI/yminmaxselector.ui index c501cb29c..ab399218d 100644 --- a/Source/GUI/yminmaxselector.ui +++ b/Source/GUI/yminmaxselector.ui @@ -23,27 +23,27 @@ Set the y-axis range - - + + - Fit to the plotted data + Full Range - true + false - - + + - Full Range + Fit to the plotted data - false + true - + @@ -112,6 +112,54 @@ + + + + + 20 + 0 + + + + false + + + background-color: "black"; + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + background-color: "dark blue"; + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + background-color: rgb(85, 0, 127) + + + QFrame::StyledPanel + + + QFrame::Raised + + +