Skip to content

Commit

Permalink
Fixed histogram text color in dark widget themes (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
shundhammer committed Aug 3, 2019
1 parent 408d8e1 commit 65b425a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/HistogramDraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ QPointF HistogramView::addText( const QPointF & pos, const QStringList & lines )
{
QGraphicsTextItem * textItem = scene()->addText( lines.join( "\n" ) );
textItem->setPos( pos );
textItem->setDefaultTextColor( Qt::black );

return QPoint( pos.x(), pos.y() + textItem->boundingRect().height() );
}
Expand All @@ -334,6 +335,7 @@ QPointF HistogramView::addBoldText( const QPointF & pos, const QString & text )
QFont boldFont( textItem->font() );
boldFont.setBold( true );
textItem->setFont( boldFont );
textItem->setDefaultTextColor( Qt::black );

return QPoint( pos.x(), pos.y() + textItem->boundingRect().height() );
}
Expand Down
2 changes: 1 addition & 1 deletion src/HistogramView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ void HistogramView::init()
_pieDiameter = 60.0;
_pieSliceOffset = 10.0;


_panelBackground = QBrush( QColor( 0xF0, 0xF0, 0xF0 ) );
_barBrush = QBrush( QColor( 0xB0, 0xB0, 0xD0 ) );
_barPen = QPen( QColor( 0x40, 0x40, 0x50 ), 1 );
Expand Down Expand Up @@ -518,6 +517,7 @@ void HistogramView::rebuild()
QGraphicsScene * newScene = new QGraphicsScene( this );
CHECK_NEW( newScene);
setScene( newScene );
scene()->setBackgroundBrush( Qt::white );

if ( _buckets.size() < 1 || _percentiles.size() != 101 )
{
Expand Down

0 comments on commit 65b425a

Please sign in to comment.