Skip to content

Commit

Permalink
Harmonize plot appearance between gradient editor and curve editor
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 22, 2017
1 parent 1688ff5 commit 7da28d1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/gui/qgscurveeditorwidget.cpp
Expand Up @@ -260,9 +260,9 @@ void QgsCurveEditorWidget::addPlotMarker( double x, double y, bool isSelected )

QwtPlotMarker *marker = new QwtPlotMarker();
#if defined(QWT_VERSION) && QWT_VERSION>=0x060000
marker->setSymbol( new QwtSymbol( QwtSymbol::Ellipse, QBrush( brushColor ), QPen( borderColor, isSelected ? 2 : 1 ), QSize( 6, 6 ) ) );
marker->setSymbol( new QwtSymbol( QwtSymbol::Ellipse, QBrush( brushColor ), QPen( borderColor, isSelected ? 2 : 1 ), QSize( 8, 8 ) ) );
#else
marker->setSymbol( QwtSymbol( QwtSymbol::Ellipse, QBrush( brushColor ), QPen( borderColor, isSelected ? 2 : 1 ), QSize( 6, 6 ) ) );
marker->setSymbol( QwtSymbol( QwtSymbol::Ellipse, QBrush( brushColor ), QPen( borderColor, isSelected ? 2 : 1 ), QSize( 8, 8 ) ) );
#endif
marker->setValue( x, y );
marker->attach( mPlot );
Expand Down
12 changes: 10 additions & 2 deletions src/gui/qgsgradientcolorrampdialog.cpp
Expand Up @@ -101,6 +101,14 @@ QgsGradientColorRampDialog::QgsGradientColorRampDialog( const QgsGradientColorRa
mPlot->setAxisScale( QwtPlot::yLeft, 0.0, 1.0 );
mPlot->enableAxis( QwtPlot::yLeft, false );

// add a grid
QwtPlotGrid * grid = new QwtPlotGrid();
QwtScaleDiv gridDiv( 0.0, 1.0, QList<double>(), QList<double>(), QList<double>() << 0.2 << 0.4 << 0.6 << 0.8 );
grid->setXDiv( gridDiv );
grid->setYDiv( gridDiv );
grid->setPen( QPen( QColor( 0, 0, 0, 50 ) ) );
grid->attach( mPlot );

mLightnessCurve = new QwtPlotCurve();
mLightnessCurve->setTitle( QStringLiteral( "Lightness" ) );
mLightnessCurve->setPen( QPen( QColor( 70, 150, 255 ), 0.0 ) ),
Expand Down Expand Up @@ -453,9 +461,9 @@ void QgsGradientColorRampDialog::addPlotMarker( double x, double y, const QColor

QwtPlotMarker *marker = new QwtPlotMarker();
#if defined(QWT_VERSION) && QWT_VERSION>=0x060000
marker->setSymbol( new QwtSymbol( QwtSymbol::Ellipse, QBrush( brushColor ), QPen( borderColor, isSelected ? 2 : 1 ), QSize( 10, 10 ) ) );
marker->setSymbol( new QwtSymbol( QwtSymbol::Ellipse, QBrush( brushColor ), QPen( borderColor, isSelected ? 2 : 1 ), QSize( 8, 8 ) ) );
#else
marker->setSymbol( QwtSymbol( QwtSymbol::Ellipse, QBrush( brushColor ), QPen( borderColor, isSelected ? 2 : 1 ), QSize( 10, 10 ) ) );
marker->setSymbol( QwtSymbol( QwtSymbol::Ellipse, QBrush( brushColor ), QPen( borderColor, isSelected ? 2 : 1 ), QSize( 8, 8 ) ) );
#endif
marker->setValue( x, y );
marker->attach( mPlot );
Expand Down

0 comments on commit 7da28d1

Please sign in to comment.