Skip to content

Commit

Permalink
Add blend modes widget to raster layer properties dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 22, 2013
1 parent 7e5abdf commit 647fbdb
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/qgsrasterlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv
mMaximumOversamplingSpinBox->setValue( resampleFilter->maxOversampling() );
}

//blend mode
mBlendModeComboBox->setBlendMode( mRasterLayer->blendMode() );

//transparency band
if ( provider )
{
Expand Down Expand Up @@ -798,6 +801,8 @@ void QgsRasterLayerProperties::apply()
resampleFilter->setMaxOversampling( mMaximumOversamplingSpinBox->value() );
}

//set the blend mode for the layer
mRasterLayer->setBlendMode(( QgsMapLayer::BlendMode ) mBlendModeComboBox->blendMode() );

//get the thumbnail for the layer
pixmapThumbnail->setPixmap( mRasterLayer->previewAsPixmap( pixmapThumbnail->size() ) );
Expand Down
51 changes: 51 additions & 0 deletions src/ui/qgsrasterlayerpropertiesbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,52 @@ p, li { white-space: pre-wrap; }
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_11">
<property name="leftMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="mBlendTypeLabel">
<property name="text">
<string>Composition blending mode</string>
</property>
<property name="margin">
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QgsBlendModeComboBox" name="mBlendModeComboBox" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="grpSRS">
<property name="title">
Expand Down Expand Up @@ -1278,6 +1324,11 @@ p, li { white-space: pre-wrap; }
<header>qgscollapsiblegroupbox.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsBlendModeComboBox</class>
<extends>QWidget</extends>
<header>qgsblendmodecombobox.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>tabBar</tabstop>
Expand Down

0 comments on commit 647fbdb

Please sign in to comment.