Skip to content

Commit

Permalink
Add a tooltip to describe why graduated histogram isn't editable
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 12, 2015
1 parent 86a45d4 commit 426465d
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/gui/symbology-ng/qgsgraduatedhistogramwidget.cpp
Expand Up @@ -85,15 +85,27 @@ void QgsGraduatedHistogramWidget::drawHistogram()
return;

bool pickerEnabled = false;
if ( !mRenderer->rangesOverlap() && !mRenderer->rangesHaveGaps() && !mRenderer->ranges().isEmpty() )
if ( mRenderer->rangesOverlap() )
{
setGraduatedRanges( mRenderer->ranges() );
pickerEnabled = true;
setToolTip( tr( "Ranges are overlapping and can't be edited by the histogram" ) );
setGraduatedRanges( QgsRangeList() );
}
else
else if ( mRenderer->rangesHaveGaps() )
{
setToolTip( tr( "Ranges have gaps and can't be edited by the histogram" ) );
setGraduatedRanges( QgsRangeList() );
}
else if ( mRenderer->ranges().isEmpty() )
{
setToolTip( QString() );
setGraduatedRanges( QgsRangeList() );
}
else
{
setToolTip( QString() );
setGraduatedRanges( mRenderer->ranges() );
pickerEnabled = true;
}
QgsHistogramWidget::drawHistogram();

// histo picker
Expand Down

0 comments on commit 426465d

Please sign in to comment.