Skip to content
Permalink
Browse files

Flip more colors buttons to QgsColorButtonV2

  • Loading branch information
nyalldawson committed Aug 12, 2014
1 parent b8bdc8f commit 3e9ab60f9450b5fa1c72d8e854c30a990cd25238
@@ -52,10 +52,16 @@ QgsDiagramProperties::QgsDiagramProperties( QgsVectorLayer* layer, QWidget* pare

mDiagramPropertiesTabWidget->setCurrentIndex( tabIdx );

mBackgroundColorButton->setColorDialogTitle( tr( "Background color" ) );
mBackgroundColorButton->setColorDialogTitle( tr( "Select background color" ) );
mBackgroundColorButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel );
mDiagramPenColorButton->setColorDialogTitle( tr( "Pen color" ) );
mBackgroundColorButton->setContext( "symbology" );
mBackgroundColorButton->setShowNoColor( true );
mBackgroundColorButton->setNoColorString( tr( "Transparent background" ) );
mDiagramPenColorButton->setColorDialogTitle( tr( "Select pen color" ) );
mDiagramPenColorButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel );
mDiagramPenColorButton->setContext( "symbology" );
mDiagramPenColorButton->setShowNoColor( true );
mDiagramPenColorButton->setNoColorString( tr( "Transparent outline" ) );

mValueLineEdit->setValidator( new QDoubleValidator( mValueLineEdit ) );
mMinimumDiagramScaleLineEdit->setValidator( new QDoubleValidator( mMinimumDiagramScaleLineEdit ) );
@@ -262,6 +262,9 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv
mMaximumOversamplingSpinBox->setValue( resampleFilter->maxOversampling() );
}

btnColorizeColor->setColorDialogTitle( tr( "Select color" ) );
btnColorizeColor->setContext( "symbology" );

// Hue and saturation color control
const QgsHueSaturationFilter* hueSaturationFilter = mRasterLayer->hueSaturationFilter();
//set hue and saturation controls to current values
@@ -35,6 +35,8 @@ QgsTextAnnotationDialog::QgsTextAnnotationDialog( QgsTextAnnotationItem* item, Q
}
mFontColorButton->setColorDialogTitle( tr( "Select font color" ) );
mFontColorButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel );
mFontColorButton->setContext( "symbology" );

setCurrentFontPropertiesToGui();

QObject::connect( mButtonBox, SIGNAL( accepted() ), this, SLOT( applyTextToItem() ) );
@@ -258,11 +258,11 @@ void QgsColorSwatchGrid::draw( QPainter &painter )
//draw header background
painter.setBrush( headerBgColor ) ;
painter.setPen( Qt::NoPen );
painter.drawRect( QRect( 0, 0, mWidth, LABEL_SIZE ) );
painter.drawRect( QRect( 0, 0, width(), LABEL_SIZE ) );

//draw header text
painter.setPen( headerTextColor );
painter.drawText( QRect( LABEL_MARGIN, 0, mWidth - 2 * LABEL_MARGIN, LABEL_SIZE ),
painter.drawText( QRect( LABEL_MARGIN, 0, width() - 2 * LABEL_MARGIN, LABEL_SIZE ),
Qt::AlignLeft | Qt::AlignVCenter, mScheme->schemeName() );

//draw color swatches
@@ -93,6 +93,11 @@ QgsPointDisplacementRendererWidget::QgsPointDisplacementRendererWidget( QgsVecto
}
}

mCircleColorButton->setColorDialogTitle( tr( "Select color" ) );
mCircleColorButton->setContext( "symbology" );
mLabelColorButton->setContext( "symbology" );
mLabelColorButton->setColorDialogTitle( tr( "Select color" ) );

mCircleWidthSpinBox->setValue( mRenderer->circleWidth() );
mCircleColorButton->setColor( mRenderer->circleColor() );
mLabelColorButton->setColor( mRenderer->labelColor() );
@@ -36,7 +36,15 @@ QgsVectorGradientColorRampV2Dialog::QgsVectorGradientColorRampV2Dialog( QgsVecto
#endif

btnColor1->setColorDialogOptions( QColorDialog::ShowAlphaChannel );
btnColor1->setColorDialogTitle( tr( "Select ramp color" ) );
btnColor1->setContext( "symbology" );
btnColor1->setShowNoColor( true );
btnColor1->setNoColorString( tr( "Transparent" ) );
btnColor2->setColorDialogOptions( QColorDialog::ShowAlphaChannel );
btnColor2->setColorDialogTitle( tr( "Select ramp color" ) );
btnColor2->setContext( "symbology" );
btnColor2->setShowNoColor( true );
btnColor2->setNoColorString( tr( "Transparent" ) );
connect( btnColor1, SIGNAL( colorChanged( const QColor& ) ), this, SLOT( setColor1( const QColor& ) ) );
connect( btnColor2, SIGNAL( colorChanged( const QColor& ) ), this, SLOT( setColor2( const QColor& ) ) );

@@ -270,6 +270,8 @@ QgsGrassRegion::QgsGrassRegion( QgsGrassPlugin *plugin, QgisInterface *iface,

// Symbology
QPen pen = mPlugin->regionPen();
mColorButton->setContext( "gui" );
mColorButton->setColorDialogTitle( tr( "Select color" ) );
mColorButton->setColor( pen.color() );
connect( mColorButton, SIGNAL( colorChanged( const QColor& ) ), this, SLOT( changeColor( const QColor& ) ) );

@@ -199,16 +199,16 @@ or change the following values</string>
</spacer>
</item>
<item row="0" column="1">
<widget class="QgsColorButton" name="mColorButton">
<widget class="QgsColorButtonV2" name="mColorButton">
<property name="minimumSize">
<size>
<width>64</width>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<width>120</width>
<height>16777215</height>
</size>
</property>
@@ -234,9 +234,9 @@ or change the following values</string>
</widget>
<customwidgets>
<customwidget>
<class>QgsColorButton</class>
<extends>QPushButton</extends>
<header>qgscolorbutton.h</header>
<class>QgsColorButtonV2</class>
<extends>QToolButton</extends>
<header>qgscolorbuttonv2.h</header>
</customwidget>
</customwidgets>
<resources/>
@@ -39,8 +39,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>743</width>
<height>761</height>
<width>756</width>
<height>627</height>
</rect>
</property>
<layout class="QVBoxLayout" name="scrollAreaLayout">
@@ -120,7 +120,7 @@
<item>
<widget class="QTabWidget" name="mDiagramPropertiesTabWidget">
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="mDiagramPropertiesTabWidgetPage1">
<attribute name="title">
@@ -130,7 +130,19 @@
<item row="0" column="0" rowspan="2">
<layout class="QGridLayout" name="gridLayout">
<item row="4" column="2">
<widget class="QgsColorButton" name="mDiagramPenColorButton">
<widget class="QgsColorButtonV2" name="mDiagramPenColorButton">
<property name="minimumSize">
<size>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
@@ -227,7 +239,19 @@
</widget>
</item>
<item row="3" column="2">
<widget class="QgsColorButton" name="mBackgroundColorButton">
<widget class="QgsColorButtonV2" name="mBackgroundColorButton">
<property name="minimumSize">
<size>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
@@ -992,9 +1016,9 @@ Leave empty to automatically apply the maximum value.</string>
</widget>
<customwidgets>
<customwidget>
<class>QgsColorButton</class>
<extends>QPushButton</extends>
<header>qgscolorbutton.h</header>
<class>QgsColorButtonV2</class>
<extends>QToolButton</extends>
<header>qgscolorbuttonv2.h</header>
</customwidget>
</customwidgets>
<resources>

0 comments on commit 3e9ab60

Please sign in to comment.
You can’t perform that action at this time.