mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Transparency slider now working (allows up to full transparency). Percentage display of slider also working.
git-svn-id: http://svn.osgeo.org/qgis/trunk@555 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
a15fc4f248
commit
251d639f18
@ -49,6 +49,8 @@ QgsRasterLayerProperties::QgsRasterLayerProperties(QgsMapLayer * lyr) : QgsRaste
|
||||
pixmapLegend->repaint(false);
|
||||
//set the transparency slider
|
||||
sliderTransparency->setValue(255-rasterLayer->getTransparency());
|
||||
//update the transparency percentage label
|
||||
sliderTransparency_valueChanged(255-rasterLayer->getTransparency());
|
||||
//decide whether user can change rgb settings
|
||||
if (rasterLayer->getBandCount() > 2)
|
||||
{
|
||||
@ -327,7 +329,12 @@ void QgsRasterLayerProperties::accept()
|
||||
apply();
|
||||
close();
|
||||
}
|
||||
|
||||
void QgsRasterLayerProperties::sliderTransparency_valueChanged( int theValue )
|
||||
{
|
||||
//set the transparency percentage label to a suitable value
|
||||
int myInt = static_cast<int>((theValue/255.0)*100); //255.0 to prevent integer division
|
||||
lblTransparencyPercent->setText(QString::number(myInt)+"%");
|
||||
}
|
||||
|
||||
void QgsRasterLayerProperties::sliderMaxRed_valueChanged( int )
|
||||
{
|
||||
|
@ -38,6 +38,7 @@ class QgsRasterLayerProperties : public QgsRasterLayerPropertiesBase
|
||||
|
||||
void apply();
|
||||
void accept();
|
||||
void sliderTransparency_valueChanged( int );
|
||||
void sliderMaxRed_valueChanged( int );
|
||||
void sliderMinRed_valueChanged( int );
|
||||
void sliderMaxBlue_valueChanged( int );
|
||||
|
@ -976,6 +976,12 @@
|
||||
<receiver>QgsRasterLayerPropertiesBase</receiver>
|
||||
<slot>sliderTransparency_sliderMoved(int)</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>sliderTransparency</sender>
|
||||
<signal>valueChanged(int)</signal>
|
||||
<receiver>QgsRasterLayerPropertiesBase</receiver>
|
||||
<slot>sliderTransparency_valueChanged(int)</slot>
|
||||
</connection>
|
||||
</connections>
|
||||
<includes>
|
||||
<include location="local" impldecl="in implementation">qgsrasterlayerpropertiesbase.ui.h</include>
|
||||
|
@ -1,4 +1,5 @@
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
** ui.h extension file, included from the uic-generated form implementation.
|
||||
**
|
||||
|
Loading…
x
Reference in New Issue
Block a user