mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6658 Fix black labels in Analysis/Corr. plots
This commit is contained in:
parent
2f03caa613
commit
d33ddf24c7
@ -21,6 +21,8 @@
|
|||||||
#include "RiaColorTables.h"
|
#include "RiaColorTables.h"
|
||||||
#include "RiaPreferences.h"
|
#include "RiaPreferences.h"
|
||||||
|
|
||||||
|
#include "RiuGuiTheme.h"
|
||||||
|
|
||||||
#include "cafFontTools.h"
|
#include "cafFontTools.h"
|
||||||
|
|
||||||
#include "qwt_column_symbol.h"
|
#include "qwt_column_symbol.h"
|
||||||
@ -33,6 +35,8 @@
|
|||||||
#include "qwt_scale_draw.h"
|
#include "qwt_scale_draw.h"
|
||||||
#include "qwt_scale_widget.h"
|
#include "qwt_scale_widget.h"
|
||||||
|
|
||||||
|
#include <QColor>
|
||||||
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
@ -109,9 +113,12 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RiuBarChartScaleDraw( const std::map<double, RiuBarChartTick>& posTickTypeAndTexts, int labelFontPointSize )
|
RiuBarChartScaleDraw( const std::map<double, RiuBarChartTick>& posTickTypeAndTexts,
|
||||||
|
int labelFontPointSize,
|
||||||
|
const QColor& textColor = QColor( Qt::white ) )
|
||||||
: m_posTickTypeAndTexts( posTickTypeAndTexts )
|
: m_posTickTypeAndTexts( posTickTypeAndTexts )
|
||||||
, m_labelFontPointSize( labelFontPointSize )
|
, m_labelFontPointSize( labelFontPointSize )
|
||||||
|
, m_textColor( textColor )
|
||||||
{
|
{
|
||||||
this->setTickLength( QwtScaleDiv::MajorTick, 0 );
|
this->setTickLength( QwtScaleDiv::MajorTick, 0 );
|
||||||
this->setTickLength( QwtScaleDiv::MediumTick, 0 );
|
this->setTickLength( QwtScaleDiv::MediumTick, 0 );
|
||||||
@ -163,6 +170,8 @@ public:
|
|||||||
text.setFont( font );
|
text.setFont( font );
|
||||||
|
|
||||||
text.setPaintAttribute( QwtText::PaintUsingTextFont, true );
|
text.setPaintAttribute( QwtText::PaintUsingTextFont, true );
|
||||||
|
text.setPaintAttribute( QwtText::PaintUsingTextColor, true );
|
||||||
|
text.setColor( m_textColor );
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
@ -312,6 +321,8 @@ private:
|
|||||||
QString m_majSpacing;
|
QString m_majSpacing;
|
||||||
|
|
||||||
int m_labelFontPointSize;
|
int m_labelFontPointSize;
|
||||||
|
|
||||||
|
QColor m_textColor;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -678,7 +689,10 @@ void RiuGroupedBarChartBuilder::addBarChartToPlot( QwtPlot* plot, Qt::Orientatio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RiuBarChartScaleDraw* scaleDrawer = new RiuBarChartScaleDraw( groupPositionedAxisTexts, m_labelPointSize );
|
QColor textColor = RiuGuiTheme::getColorByVariableName( "textColor" );
|
||||||
|
|
||||||
|
RiuBarChartScaleDraw* scaleDrawer =
|
||||||
|
new RiuBarChartScaleDraw( groupPositionedAxisTexts, m_labelPointSize, textColor );
|
||||||
|
|
||||||
plot->setAxisScaleDraw( axis, scaleDrawer );
|
plot->setAxisScaleDraw( axis, scaleDrawer );
|
||||||
plot->setAxisScaleDiv( axis, groupAxisScaleDiv );
|
plot->setAxisScaleDiv( axis, groupAxisScaleDiv );
|
||||||
|
Loading…
Reference in New Issue
Block a user