mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-01 03:37:15 -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 "RiuNightchartsWidget.h"
|
||||||
|
#include "RiuGuiTheme.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
@ -89,6 +90,9 @@ void RiuNightchartsWidget::clear()
|
|||||||
m_chart.setLegendType( Nightcharts::Vertical );
|
m_chart.setLegendType( Nightcharts::Vertical );
|
||||||
m_chart.setShadows( false );
|
m_chart.setShadows( false );
|
||||||
|
|
||||||
|
auto col = RiuGuiTheme::getColorByVariableName( "textColor" );
|
||||||
|
m_chart.setTextColor( col );
|
||||||
|
|
||||||
m_marginLeft = 10;
|
m_marginLeft = 10;
|
||||||
m_marginTop = 10;
|
m_marginTop = 10;
|
||||||
m_maxNameWidth = 0;
|
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
|
// Was originally uninitialized, and caused overflow issues and invalid drawing when running debug
|
||||||
// Suggest rewrite and use locally defined aggregatedAngle (see below for usage)
|
// Suggest rewrite and use locally defined aggregatedAngle (see below for usage)
|
||||||
palpha = 0.0;
|
palpha = 0.0;
|
||||||
|
|
||||||
|
textColor = QPalette().color(QPalette::Text);
|
||||||
}
|
}
|
||||||
|
|
||||||
Nightcharts::~Nightcharts()
|
Nightcharts::~Nightcharts()
|
||||||
@ -350,9 +352,6 @@ void Nightcharts::drawLegend(QPainter *painter)
|
|||||||
//double ptext = 25;
|
//double ptext = 25;
|
||||||
double angle = palpha;
|
double angle = palpha;
|
||||||
painter->setPen(Qt::SolidLine);
|
painter->setPen(Qt::SolidLine);
|
||||||
|
|
||||||
QPalette palette;
|
|
||||||
QColor textColor = palette.color(QPalette::Text);
|
|
||||||
painter->setPen(textColor);
|
painter->setPen(textColor);
|
||||||
|
|
||||||
switch(cltype)
|
switch(cltype)
|
||||||
@ -465,3 +464,11 @@ int Nightcharts::pieceCount() const
|
|||||||
{
|
{
|
||||||
return pieces.count();
|
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);
|
int draw(QPainter *painter);
|
||||||
void drawLegend(QPainter *painter);
|
void drawLegend(QPainter *painter);
|
||||||
int pieceCount() const;
|
int pieceCount() const;
|
||||||
|
void setTextColor(const QColor& color);
|
||||||
double palpha;
|
double palpha;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -72,6 +73,7 @@ private:
|
|||||||
QVector<pieceNC> pieces;
|
QVector<pieceNC> pieces;
|
||||||
int ctype, cltype;
|
int ctype, cltype;
|
||||||
QFont font;
|
QFont font;
|
||||||
|
QColor textColor;
|
||||||
//QPainter *cpainter;
|
//QPainter *cpainter;
|
||||||
QPointF GetPoint(double angle, double R1 = 0, double R2 = 0);
|
QPointF GetPoint(double angle, double R1 = 0, double R2 = 0);
|
||||||
int GetQuater(double angle);
|
int GetQuater(double angle);
|
||||||
|
Loading…
Reference in New Issue
Block a user