mirror of
https://github.com/OPM/ResInsight.git
synced 2024-12-29 10:21:54 -06:00
#6514 Dark Theme : Fix text color in nightcharts
This commit is contained in:
parent
0b44f6ab18
commit
2cfa900041
@ -17,6 +17,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiuNightchartsWidget.h"
|
||||
#include "RiuGuiTheme.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -89,6 +90,9 @@ void RiuNightchartsWidget::clear()
|
||||
m_chart.setLegendType( Nightcharts::Vertical );
|
||||
m_chart.setShadows( false );
|
||||
|
||||
auto col = RiuGuiTheme::getColorByVariableName( "textColor" );
|
||||
m_chart.setTextColor( col );
|
||||
|
||||
m_marginLeft = 10;
|
||||
m_marginTop = 10;
|
||||
m_maxNameWidth = 0;
|
||||
|
13
ThirdParty/nightcharts/nightcharts.cpp
vendored
13
ThirdParty/nightcharts/nightcharts.cpp
vendored
@ -45,6 +45,8 @@ Nightcharts::Nightcharts()//QPainter *painter)
|
||||
// Was originally uninitialized, and caused overflow issues and invalid drawing when running debug
|
||||
// Suggest rewrite and use locally defined aggregatedAngle (see below for usage)
|
||||
palpha = 0.0;
|
||||
|
||||
textColor = QPalette().color(QPalette::Text);
|
||||
}
|
||||
|
||||
Nightcharts::~Nightcharts()
|
||||
@ -350,9 +352,6 @@ void Nightcharts::drawLegend(QPainter *painter)
|
||||
//double ptext = 25;
|
||||
double angle = palpha;
|
||||
painter->setPen(Qt::SolidLine);
|
||||
|
||||
QPalette palette;
|
||||
QColor textColor = palette.color(QPalette::Text);
|
||||
painter->setPen(textColor);
|
||||
|
||||
switch(cltype)
|
||||
@ -465,3 +464,11 @@ int Nightcharts::pieceCount() const
|
||||
{
|
||||
return pieces.count();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Nightcharts::setTextColor(const QColor& color)
|
||||
{
|
||||
textColor = color;
|
||||
}
|
||||
|
2
ThirdParty/nightcharts/nightcharts.h
vendored
2
ThirdParty/nightcharts/nightcharts.h
vendored
@ -63,6 +63,7 @@ public:
|
||||
int draw(QPainter *painter);
|
||||
void drawLegend(QPainter *painter);
|
||||
int pieceCount() const;
|
||||
void setTextColor(const QColor& color);
|
||||
double palpha;
|
||||
|
||||
private:
|
||||
@ -72,6 +73,7 @@ private:
|
||||
QVector<pieceNC> pieces;
|
||||
int ctype, cltype;
|
||||
QFont font;
|
||||
QColor textColor;
|
||||
//QPainter *cpainter;
|
||||
QPointF GetPoint(double angle, double R1 = 0, double R2 = 0);
|
||||
int GetQuater(double angle);
|
||||
|
Loading…
Reference in New Issue
Block a user