Skip to content

Commit 7da28d1

Browse files
committedFeb 22, 2017
Harmonize plot appearance between gradient editor and curve editor
1 parent 1688ff5 commit 7da28d1

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed
 

‎src/gui/qgscurveeditorwidget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,9 @@ void QgsCurveEditorWidget::addPlotMarker( double x, double y, bool isSelected )
260260

261261
QwtPlotMarker *marker = new QwtPlotMarker();
262262
#if defined(QWT_VERSION) && QWT_VERSION>=0x060000
263-
marker->setSymbol( new QwtSymbol( QwtSymbol::Ellipse, QBrush( brushColor ), QPen( borderColor, isSelected ? 2 : 1 ), QSize( 6, 6 ) ) );
263+
marker->setSymbol( new QwtSymbol( QwtSymbol::Ellipse, QBrush( brushColor ), QPen( borderColor, isSelected ? 2 : 1 ), QSize( 8, 8 ) ) );
264264
#else
265-
marker->setSymbol( QwtSymbol( QwtSymbol::Ellipse, QBrush( brushColor ), QPen( borderColor, isSelected ? 2 : 1 ), QSize( 6, 6 ) ) );
265+
marker->setSymbol( QwtSymbol( QwtSymbol::Ellipse, QBrush( brushColor ), QPen( borderColor, isSelected ? 2 : 1 ), QSize( 8, 8 ) ) );
266266
#endif
267267
marker->setValue( x, y );
268268
marker->attach( mPlot );

‎src/gui/qgsgradientcolorrampdialog.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ QgsGradientColorRampDialog::QgsGradientColorRampDialog( const QgsGradientColorRa
101101
mPlot->setAxisScale( QwtPlot::yLeft, 0.0, 1.0 );
102102
mPlot->enableAxis( QwtPlot::yLeft, false );
103103

104+
// add a grid
105+
QwtPlotGrid * grid = new QwtPlotGrid();
106+
QwtScaleDiv gridDiv( 0.0, 1.0, QList<double>(), QList<double>(), QList<double>() << 0.2 << 0.4 << 0.6 << 0.8 );
107+
grid->setXDiv( gridDiv );
108+
grid->setYDiv( gridDiv );
109+
grid->setPen( QPen( QColor( 0, 0, 0, 50 ) ) );
110+
grid->attach( mPlot );
111+
104112
mLightnessCurve = new QwtPlotCurve();
105113
mLightnessCurve->setTitle( QStringLiteral( "Lightness" ) );
106114
mLightnessCurve->setPen( QPen( QColor( 70, 150, 255 ), 0.0 ) ),
@@ -453,9 +461,9 @@ void QgsGradientColorRampDialog::addPlotMarker( double x, double y, const QColor
453461

454462
QwtPlotMarker *marker = new QwtPlotMarker();
455463
#if defined(QWT_VERSION) && QWT_VERSION>=0x060000
456-
marker->setSymbol( new QwtSymbol( QwtSymbol::Ellipse, QBrush( brushColor ), QPen( borderColor, isSelected ? 2 : 1 ), QSize( 10, 10 ) ) );
464+
marker->setSymbol( new QwtSymbol( QwtSymbol::Ellipse, QBrush( brushColor ), QPen( borderColor, isSelected ? 2 : 1 ), QSize( 8, 8 ) ) );
457465
#else
458-
marker->setSymbol( QwtSymbol( QwtSymbol::Ellipse, QBrush( brushColor ), QPen( borderColor, isSelected ? 2 : 1 ), QSize( 10, 10 ) ) );
466+
marker->setSymbol( QwtSymbol( QwtSymbol::Ellipse, QBrush( brushColor ), QPen( borderColor, isSelected ? 2 : 1 ), QSize( 8, 8 ) ) );
459467
#endif
460468
marker->setValue( x, y );
461469
marker->attach( mPlot );

0 commit comments

Comments
 (0)
Please sign in to comment.