88 changes: 49 additions & 39 deletions python/console_sci.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(self, parent=None):

self.buffer = []

self.insertInitText()
#self.insertInitText()
self.displayPrompt(False)

for line in _init_commands:
Expand All @@ -69,8 +69,8 @@ def __init__(self, parent=None):
#self.selectToMatchingBrace()

# Current line visible with special background color
self.setCaretLineVisible(True)
self.setCaretLineBackgroundColor(QColor("#ffe4e4"))
#self.setCaretLineVisible(True)
#self.setCaretLineBackgroundColor(QColor("#ffe4e4"))
self.setCaretWidth(2)

# Set Python lexer
Expand All @@ -93,12 +93,14 @@ def __init__(self, parent=None):
# Use raw message to Scintilla here (all messages are documented
# here: http://www.scintilla.org/ScintillaDoc.html)
self.SendScintilla(QsciScintilla.SCI_SETHSCROLLBAR, 0)
self.SendScintilla(QsciScintilla.SCI_SETVSCROLLBAR, 0)


# not too small
#self.setMinimumSize(500, 300)
self.setMinimumHeight(125)
self.setMinimumHeight(32)

self.SendScintilla(QsciScintilla.SCI_SETWRAPMODE, 1)
self.SendScintilla(QsciScintilla.SCI_SETWRAPMODE, 2)
self.SendScintilla(QsciScintilla.SCI_EMPTYUNDOBUFFER)

## Disable command key
Expand All @@ -117,20 +119,14 @@ def __init__(self, parent=None):
self.newShortcutCAS.activated.connect(self.showHistory)
self.connect(self, SIGNAL('userListActivated(int, const QString)'),
self.completion_list_selected)

self.createStandardContextMenu()

def showHistory(self):
self.showUserList(1, QStringList(self.history))

def autoComplete(self):
self.autoCompleteFromAll()

def clearConsole(self):
"""Clear the contents of the console."""
self.SendScintilla(QsciScintilla.SCI_CLEARALL)
#self.setText('')
self.insertInitText()
self.displayPrompt(False)
self.setFocus()

def commandConsole(self, command):
if not self.is_cursor_on_last_line():
Expand All @@ -142,23 +138,20 @@ def commandConsole(self, command):
if command == "iface":
"""Import QgisInterface class"""
self.append('from qgis.utils import iface')
self.move_cursor_to_end()
elif command == "sextante":
"""Import Sextante class"""
self.append('from sextante.core.Sextante import Sextante')
self.move_cursor_to_end()
elif command == "cLayer":
"""Retrieve current Layer from map camvas"""
self.append('cLayer = iface.mapCanvas().currentLayer()')
self.move_cursor_to_end()
elif command == "qtCore":
"""Import QtCore class"""
self.append('from PyQt4.QtCore import *')
self.move_cursor_to_end()
elif command == "qtGui":
"""Import QtGui class"""
self.append('from PyQt4.QtGui import *')
self.move_cursor_to_end()
self.entered()
self.move_cursor_to_end()
self.setFocus()

def setLexers(self):
Expand All @@ -172,6 +165,10 @@ def setLexers(self):
font = QFont(loadFont)
font.setFixedPitch(True)
font.setPointSize(fontSize)
font.setStyleHint(QFont.TypeWriter)
font.setStretch(QFont.SemiCondensed)
font.setLetterSpacing(QFont.PercentageSpacing, 87.0)
font.setBold(False)

self.lexer.setDefaultFont(font)
self.lexer.setColor(Qt.red, 1)
Expand Down Expand Up @@ -209,9 +206,9 @@ def completion_list_selected(self, id, txt):

def insertInitText(self):
#self.setLexers(False)
txtInit = QCoreApplication.translate("PythonConsole",
"## To access Quantum GIS environment from this console\n"
"## use qgis.utils.iface object (instance of QgisInterface class). Read help for more info.\n\n")
txtInit = QCoreApplication.translate("PythonConsole", "## Interactive Python Console for Quantum GIS\n\n")
#"## To access Quantum GIS environment from this console\n"
#"## use qgis.utils.iface object (instance of QgisInterface class). Read help for more info.\n\n")
initText = self.setText(txtInit)

def getText(self):
Expand Down Expand Up @@ -413,6 +410,16 @@ def keyPressEvent(self, e):
## TODO: press event for auto-completion file directory
else:
QsciScintilla.keyPressEvent(self, e)

def contextMenuEvent(self, e):
menu = QMenu(self)
copyAction = menu.addAction("Copy CTRL+C")
pasteAction = menu.addAction("Paste CTRL+V")
action = menu.exec_(self.mapToGlobal(e.pos()))
if action == copyAction:
self.copy()
elif action == pasteAction:
self.paste()

def mousePressEvent(self, e):
"""
Expand Down Expand Up @@ -458,18 +465,20 @@ def dropEvent(self, e):
def insertFromDropPaste(self, textDP):
pasteList = textDP.split("\n")
for line in pasteList[:-1]:
line.replace(">>> ", "").replace("... ", "")
self.insert(line)
self.move_cursor_to_end()
#self.SendScintilla(QsciScintilla.SCI_DELETEBACK)
self.runCommand(unicode(self.currentCommand()))
if pasteList[-1] != "":
self.insert(unicode(pasteList[-1]))
line = pasteList[-1]
line.replace(">>> ", "").replace("... ", "")
self.insert(unicode(line))
self.move_cursor_to_end()

def getTextFromEditor(self):
text = self.text()
textList = text.split("\n")
return textList
# def getTextFromEditor(self):
# text = self.text()
# textList = text.split("\n")
# return textList

def insertTextFromFile(self, listOpenFile):
for line in listOpenFile[:-1]:
Expand All @@ -483,7 +492,7 @@ def insertTextFromFile(self, listOpenFile):

def entered(self):
self.move_cursor_to_end()
self.runCommand( unicode(self.currentCommand()) )
self.runCommand( unicode(self.currentCommand()) )
self.setFocus()
self.move_cursor_to_end()
#self.SendScintilla(QsciScintilla.SCI_EMPTYUNDOBUFFER)
Expand All @@ -498,9 +507,14 @@ def currentCommand(self):
return cmd

def runCommand(self, cmd):
self.write_stdout(cmd)
import webbrowser
self.updateHistory(cmd)
self.SendScintilla(QsciScintilla.SCI_NEWLINE)
line, pos = self.getCursorPosition()
selCmdLenght = self.text(line).length()
self.setSelection(line, 0, line, selCmdLenght)
self.removeSelectedText()
#self.SendScintilla(QsciScintilla.SCI_NEWLINE)
if cmd in ('_save', '_clear', '_clearAll', '_pyqgis', '_api'):
if cmd == '_save':
self.writeHistoryFile()
Expand Down Expand Up @@ -528,25 +542,21 @@ def runCommand(self, cmd):
elif cmd == '_api':
webbrowser.open( "http://www.qgis.org/api/" )

output = sys.stdout.get_and_clean_data()
if output:
self.append(output)
self.displayPrompt(False)
else:
self.buffer.append(cmd)
src = u"\n".join(self.buffer)
more = self.runsource(src, "<input>")
if not more:
self.buffer = []
output = sys.stdout.get_and_clean_data()
if output:
self.append(output)
self.move_cursor_to_end()
self.displayPrompt(more)

def write(self, txt):
self.SendScintilla(QsciScintilla.SCI_SETSTYLING, len(txt), 1)
self.append(txt)
self.SendScintilla(QsciScintilla.SCI_SETSTYLING, len(txt), 1)

sys.stderr.write(txt)

def write_stdout(self, txt):
if len(txt) > 0:
getCmdString = self.text()
prompt = getCmdString[0:4]
sys.stdout.write(prompt+txt+'\n')
3 changes: 0 additions & 3 deletions python/core/raster/qgsrasterrenderer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ class QgsRasterRenderer : QgsRasterInterface
void setAlphaBand( int band );
int alphaBand() const;

void setInvertColor( bool invert );
bool invertColor() const;

/**Get symbology items if provided by renderer*/
virtual void legendSymbologyItems( QList< QPair< QString, QColor > >& symbolItems ) const;

Expand Down
10 changes: 1 addition & 9 deletions src/app/qgsrasterlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv
tableTransparency->horizontalHeader()->setResizeMode( 1, QHeaderView::Stretch );

//resampling
mResamplingGroupBox->setSaveCheckedState( true );
const QgsRasterRenderer* renderer = mRasterLayer->renderer();
mZoomedInResamplingComboBox->insertItem( 0, tr( "Nearest neighbour" ) );
mZoomedInResamplingComboBox->insertItem( 1, tr( "Bilinear" ) );
Expand All @@ -206,12 +207,6 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv
//set combo boxes to current resampling types
if ( resampleFilter )
{
//invert color map
if ( renderer->invertColor() )
{
mInvertColorMapCheckBox->setCheckState( Qt::Checked );
}

const QgsRasterResampler* zoomedInResampler = resampleFilter->zoomedInResampler();
if ( zoomedInResampler )
{
Expand Down Expand Up @@ -744,9 +739,6 @@ void QgsRasterLayerProperties::apply()

//set global transparency
rasterRenderer->setOpacity(( 255 - sliderTransparency->value() ) / 255.0 );

//invert color map
rasterRenderer->setInvertColor( mInvertColorMapCheckBox->isChecked() );
}

QgsDebugMsg( "processing general tab" );
Expand Down
11 changes: 1 addition & 10 deletions src/core/raster/qgsmultibandcolorrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ QgsRasterInterface * QgsMultiBandColorRenderer::clone() const
}
renderer->setOpacity( mOpacity );
renderer->setAlphaBand( mAlphaBand );
renderer->setInvertColor( mInvertColor );
renderer->setRasterTransparency( mRasterTransparency );

return renderer;
Expand Down Expand Up @@ -136,8 +135,7 @@ QgsRasterBlock* QgsMultiBandColorRenderer::block( int bandNo, QgsRectangle cons
//In some (common) cases, we can simplify the drawing loop considerably and save render time
bool fastDraw = ( !usesTransparency()
&& mRedBand > 0 && mGreenBand > 0 && mBlueBand > 0
&& mAlphaBand < 1 && !mRedContrastEnhancement && !mGreenContrastEnhancement && !mBlueContrastEnhancement
&& !mInvertColor );
&& mAlphaBand < 1 && !mRedContrastEnhancement && !mGreenContrastEnhancement && !mBlueContrastEnhancement );

QSet<int> bands;
if ( mRedBand > 0 )
Expand Down Expand Up @@ -290,13 +288,6 @@ QgsRasterBlock* QgsMultiBandColorRenderer::block( int bandNo, QgsRectangle cons
blueVal = mBlueContrastEnhancement->enhanceContrast( blueVal );
}

if ( mInvertColor )
{
redVal = 255 - redVal;
greenVal = 255 - greenVal;
blueVal = 255 - blueVal;
}

//opacity
double currentOpacity = mOpacity;
if ( mRasterTransparency )
Expand Down
10 changes: 1 addition & 9 deletions src/core/raster/qgspalettedrasterrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ QgsRasterInterface * QgsPalettedRasterRenderer::clone() const
QgsPalettedRasterRenderer * renderer = new QgsPalettedRasterRenderer( 0, mBand, colors(), mNColors );
renderer->setOpacity( mOpacity );
renderer->setAlphaBand( mAlphaBand );
renderer->setInvertColor( mInvertColor );
renderer->setRasterTransparency( mRasterTransparency );
return renderer;
}
Expand Down Expand Up @@ -179,14 +178,7 @@ QgsRasterBlock * QgsPalettedRasterRenderer::block( int bandNo, QgsRectangle con
}
QColor& currentColor = mColors[val];

if ( mInvertColor )
{
outputBlock->setColor( i, qRgba( currentOpacity * currentColor.blue(), currentOpacity * currentColor.green(), currentOpacity * currentColor.red(), currentOpacity * 255 ) );
}
else
{
outputBlock->setColor( i, qRgba( currentOpacity * currentColor.red(), currentOpacity * currentColor.green(), currentOpacity * currentColor.blue(), currentOpacity * 255 ) );
}
outputBlock->setColor( i, qRgba( currentOpacity * currentColor.red(), currentOpacity * currentColor.green(), currentOpacity * currentColor.blue(), currentOpacity * 255 ) );
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/core/raster/qgsrasterrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const QRgb QgsRasterRenderer::NODATA_COLOR = qRgba( 0, 0, 0, 0 );
QgsRasterRenderer::QgsRasterRenderer( QgsRasterInterface* input, const QString& type )
: QgsRasterInterface( input )
, mType( type ), mOpacity( 1.0 ), mRasterTransparency( 0 )
, mAlphaBand( -1 ), mInvertColor( false )
, mAlphaBand( -1 ) //, mInvertColor( false )
{
}

Expand Down Expand Up @@ -117,7 +117,7 @@ void QgsRasterRenderer::_writeXML( QDomDocument& doc, QDomElement& rasterRendere
rasterRendererElem.setAttribute( "type", mType );
rasterRendererElem.setAttribute( "opacity", QString::number( mOpacity ) );
rasterRendererElem.setAttribute( "alphaBand", mAlphaBand );
rasterRendererElem.setAttribute( "invertColor", mInvertColor );
//rasterRendererElem.setAttribute( "invertColor", mInvertColor );

if ( mRasterTransparency )
{
Expand All @@ -135,7 +135,7 @@ void QgsRasterRenderer::readXML( const QDomElement& rendererElem )
mType = rendererElem.attribute( "type" );
mOpacity = rendererElem.attribute( "opacity", "1.0" ).toDouble();
mAlphaBand = rendererElem.attribute( "alphaBand", "-1" ).toInt();
mInvertColor = rendererElem.attribute( "invertColor", "0" ).toInt();
//mInvertColor = rendererElem.attribute( "invertColor", "0" ).toInt();

//todo: read mRasterTransparency
QDomElement rasterTransparencyElem = rendererElem.firstChildElement( "rasterTransparency" );
Expand Down
6 changes: 3 additions & 3 deletions src/core/raster/qgsrasterrenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ class CORE_EXPORT QgsRasterRenderer : public QgsRasterInterface
void setAlphaBand( int band ) { mAlphaBand = band; }
int alphaBand() const { return mAlphaBand; }

void setInvertColor( bool invert ) { mInvertColor = invert; }
bool invertColor() const { return mInvertColor; }
//void setInvertColor( bool invert ) { mInvertColor = invert; }
//bool invertColor() const { return mInvertColor; }

/**Get symbology items if provided by renderer*/
virtual void legendSymbologyItems( QList< QPair< QString, QColor > >& symbolItems ) const { Q_UNUSED( symbolItems ); }
Expand Down Expand Up @@ -124,7 +124,7 @@ class CORE_EXPORT QgsRasterRenderer : public QgsRasterInterface
Default: -1 (not set)*/
int mAlphaBand;

bool mInvertColor;
//bool mInvertColor;
};

#endif // QGSRASTERRENDERER_H
1 change: 0 additions & 1 deletion src/core/raster/qgssinglebandcolordatarenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ QgsRasterInterface * QgsSingleBandColorDataRenderer::clone() const
QgsSingleBandColorDataRenderer * renderer = new QgsSingleBandColorDataRenderer( 0, mBand );
renderer->setOpacity( mOpacity );
renderer->setAlphaBand( mAlphaBand );
renderer->setInvertColor( mInvertColor );
renderer->setRasterTransparency( mRasterTransparency );
return renderer;
}
Expand Down
22 changes: 19 additions & 3 deletions src/core/raster/qgssinglebandgrayrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <QImage>

QgsSingleBandGrayRenderer::QgsSingleBandGrayRenderer( QgsRasterInterface* input, int grayBand ):
QgsRasterRenderer( input, "singlebandgray" ), mGrayBand( grayBand ), mContrastEnhancement( 0 )
QgsRasterRenderer( input, "singlebandgray" ), mGrayBand( grayBand ), mGradient( BlackToWhite ), mContrastEnhancement( 0 )
{
}

Expand All @@ -37,7 +37,6 @@ QgsRasterInterface * QgsSingleBandGrayRenderer::clone() const
QgsSingleBandGrayRenderer * renderer = new QgsSingleBandGrayRenderer( 0, mGrayBand );
renderer->setOpacity( mOpacity );
renderer->setAlphaBand( mAlphaBand );
renderer->setInvertColor( mInvertColor );
renderer->setRasterTransparency( mRasterTransparency );
if ( mContrastEnhancement )
{
Expand All @@ -57,6 +56,11 @@ QgsRasterRenderer* QgsSingleBandGrayRenderer::create( const QDomElement& elem, Q
QgsSingleBandGrayRenderer* r = new QgsSingleBandGrayRenderer( input, grayBand );
r->readXML( elem );

if ( elem.attribute( "gradient" ) == "WhiteToBlack" )
{
r->setGradient( WhiteToBlack ); // BlackToWhite is default
}

QDomElement contrastEnhancementElem = elem.firstChildElement( "contrastEnhancement" );
if ( !contrastEnhancementElem.isNull() )
{
Expand Down Expand Up @@ -149,7 +153,7 @@ QgsRasterBlock* QgsSingleBandGrayRenderer::block( int bandNo, QgsRectangle cons
grayVal = mContrastEnhancement->enhanceContrast( grayVal );
}

if ( mInvertColor )
if ( mGradient == WhiteToBlack )
{
grayVal = 255 - grayVal;
}
Expand Down Expand Up @@ -184,6 +188,18 @@ void QgsSingleBandGrayRenderer::writeXML( QDomDocument& doc, QDomElement& parent
_writeXML( doc, rasterRendererElem );

rasterRendererElem.setAttribute( "grayBand", mGrayBand );

QString gradient;
if ( mGradient == BlackToWhite )
{
gradient = "BlackToWhite";
}
else
{
gradient = "WhiteToBlack";
}
rasterRendererElem.setAttribute( "gradient", gradient );

if ( mContrastEnhancement )
{
QDomElement contrastElem = doc.createElement( "contrastEnhancement" );
Expand Down
10 changes: 10 additions & 0 deletions src/core/raster/qgssinglebandgrayrenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ class QDomElement;
class CORE_EXPORT QgsSingleBandGrayRenderer: public QgsRasterRenderer
{
public:
enum Gradient
{
BlackToWhite,
WhiteToBlack
};

QgsSingleBandGrayRenderer( QgsRasterInterface* input, int grayBand );
~QgsSingleBandGrayRenderer();
QgsRasterInterface * clone() const;
Expand All @@ -43,6 +49,9 @@ class CORE_EXPORT QgsSingleBandGrayRenderer: public QgsRasterRenderer
/**Takes ownership*/
void setContrastEnhancement( QgsContrastEnhancement* ce );

void setGradient( Gradient theGradient ) { mGradient = theGradient; }
Gradient gradient() const { return mGradient; }

void writeXML( QDomDocument& doc, QDomElement& parentElem ) const;

void legendSymbologyItems( QList< QPair< QString, QColor > >& symbolItems ) const;
Expand All @@ -51,6 +60,7 @@ class CORE_EXPORT QgsSingleBandGrayRenderer: public QgsRasterRenderer

private:
int mGrayBand;
Gradient mGradient;
QgsContrastEnhancement* mContrastEnhancement;
};

Expand Down
9 changes: 0 additions & 9 deletions src/core/raster/qgssinglebandpseudocolorrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ QgsRasterInterface * QgsSingleBandPseudoColorRenderer::clone() const

renderer->setOpacity( mOpacity );
renderer->setAlphaBand( mAlphaBand );
renderer->setInvertColor( mInvertColor );
renderer->setRasterTransparency( mRasterTransparency );

return renderer;
Expand Down Expand Up @@ -165,14 +164,6 @@ QgsRasterBlock* QgsSingleBandPseudoColorRenderer::block( int bandNo, QgsRectangl
continue;
}

if ( mInvertColor )
{
// 1.8 was flipping blue and red
red = 255 - red;
green = 255 - green;
blue = 255 - blue;
}

if ( !hasTransparency )
{
outputBlock->setColor( i, qRgba( red, green, blue, 255 ) );
Expand Down
15 changes: 14 additions & 1 deletion src/gui/raster/qgssinglebandgrayrendererwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ QgsSingleBandGrayRendererWidget::QgsSingleBandGrayRendererWidget( QgsRasterLayer
{
setupUi( this );

mGradientComboBox->insertItem( 0, tr( "Black to white" ), QgsSingleBandGrayRenderer::BlackToWhite );
mGradientComboBox->insertItem( 1, tr( "White to black" ), QgsSingleBandGrayRenderer::WhiteToBlack );

mMinLineEdit->setValidator( new QDoubleValidator( mMinLineEdit ) );
mMaxLineEdit->setValidator( new QDoubleValidator( mMaxLineEdit ) );

Expand All @@ -36,7 +39,12 @@ QgsSingleBandGrayRendererWidget::QgsSingleBandGrayRendererWidget( QgsRasterLayer

mMinMaxWidget = new QgsRasterMinMaxWidget( layer, this );
mMinMaxWidget->setExtent( extent );
layout()->addWidget( mMinMaxWidget );

QHBoxLayout *layout = new QHBoxLayout();
layout->setContentsMargins( 0, 0, 0, 0 );
mMinMaxContainerWidget->setLayout( layout );
layout->addWidget( mMinMaxWidget );

connect( mMinMaxWidget, SIGNAL( load( int, double, double, int ) ),
this, SLOT( loadMinMax( int, double, double, int ) ) );

Expand Down Expand Up @@ -84,6 +92,9 @@ QgsRasterRenderer* QgsSingleBandGrayRendererWidget::renderer()

QgsSingleBandGrayRenderer* renderer = new QgsSingleBandGrayRenderer( provider, band );
renderer->setContrastEnhancement( e );

renderer->setGradient(( QgsSingleBandGrayRenderer::Gradient ) mGradientComboBox->itemData( mGradientComboBox->currentIndex() ).toInt() );

return renderer;
}

Expand Down Expand Up @@ -127,6 +138,8 @@ void QgsSingleBandGrayRendererWidget::setFromRenderer( const QgsRasterRenderer*
//band
mGrayBandComboBox->setCurrentIndex( mGrayBandComboBox->findData( gr->grayBand() ) );
const QgsContrastEnhancement* ce = gr->contrastEnhancement();

mGradientComboBox->setCurrentIndex( mGradientComboBox->findData( gr->gradient() ) );
//minmax
mMinLineEdit->setText( QString::number( ce->minimumValue() ) );
mMaxLineEdit->setText( QString::number( ce->maximumValue() ) );
Expand Down
6 changes: 4 additions & 2 deletions src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,17 @@ void QgsSingleBandPseudoColorRendererWidget::on_mClassifyButton_clicked()
for ( int i = 0; i < numberOfEntries; ++i )
{
QColor currentColor;
currentColor.setRgb( colorDiff*i, 0, 255 - colorDiff * i );
int idx = mInvertCheckBox->isChecked() ? numberOfEntries - i - 1 : i;
currentColor.setRgb( colorDiff*idx, 0, 255 - colorDiff * idx );
entryColors.push_back( currentColor );
}
}
else
{
for ( int i = 0; i < numberOfEntries; ++i )
{
entryColors.push_back( colorRamp->color((( double ) i ) / numberOfEntries ) );
int idx = mInvertCheckBox->isChecked() ? numberOfEntries - i - 1 : i;
entryColors.push_back( colorRamp->color((( double ) idx ) / numberOfEntries ) );
}
}

Expand Down
1,059 changes: 555 additions & 504 deletions src/ui/qgsrasterlayerpropertiesbase.ui

Large diffs are not rendered by default.

55 changes: 47 additions & 8 deletions src/ui/qgssinglebandgrayrendererwidgetbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>258</width>
<height>203</height>
<width>463</width>
<height>298</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -16,17 +16,17 @@
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="0">
<item row="4" column="0">
<widget class="QLabel" name="mContrastEnhancementLabel">
<property name="text">
<string>Contrast enhancement</string>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="2" column="1">
<widget class="QLineEdit" name="mMinLineEdit"/>
</item>
<item row="3" column="1">
<item row="4" column="1">
<widget class="QComboBox" name="mContrastEnhancementComboBox"/>
</item>
<item row="0" column="0">
Expand All @@ -36,7 +36,7 @@
</property>
</widget>
</item>
<item row="1" column="0">
<item row="2" column="0">
<widget class="QLabel" name="mMinLabel">
<property name="text">
<string>Min</string>
Expand All @@ -46,18 +46,57 @@
<item row="0" column="1">
<widget class="QComboBox" name="mGrayBandComboBox"/>
</item>
<item row="2" column="0">
<item row="3" column="0">
<widget class="QLabel" name="mMaxLabel">
<property name="text">
<string>Max</string>
</property>
</widget>
</item>
<item row="2" column="1">
<item row="3" column="1">
<widget class="QLineEdit" name="mMaxLineEdit"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Color gradient</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="mGradientComboBox"/>
</item>
<item row="5" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>140</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QWidget" name="mMinMaxContainerWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
Expand Down
8 changes: 7 additions & 1 deletion src/ui/qgssinglebandpseudocolorrendererwidgetbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,13 @@
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="mInvertCheckBox">
<property name="text">
<string>Invert colors order</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand All @@ -356,7 +363,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<zorder>grpGenerateColorMap</zorder>
</widget>
</item>
</layout>
Expand Down